Comments on: Hacking PHP syntax http://systemsarchitect.net/hacking-php-syntax/ Software Design & Programming Wed, 04 Feb 2015 09:28:59 +0000 hourly 1 http://wordpress.org/?v=3.9.8 By: Lukasz Kujawa http://systemsarchitect.net/hacking-php-syntax/#comment-802 Sat, 11 May 2013 08:13:05 +0000 http://systemsarchitect.net/?p=696#comment-802 Thank you for your comment. I agree. It doesn’t sound like a super easy tweak.

]]>
By: solu http://systemsarchitect.net/hacking-php-syntax/#comment-771 Fri, 10 May 2013 09:51:31 +0000 http://systemsarchitect.net/?p=696#comment-771 It’s fun! :)
I want to add array slice syntax like Python (list[1:2]),
but I found it’s too hard for me.

]]>
By: Lukasz Kujawa http://systemsarchitect.net/hacking-php-syntax/#comment-594 Thu, 02 May 2013 09:06:50 +0000 http://systemsarchitect.net/?p=696#comment-594 Hello Theodore. Your question is more related to extending PHP than hacking the Zend engine. Function “strpos” is part of the standard extension and is defined in “ext/standard/string.c” – grep for “PHP_FUNCTION(strpos)”. In this case I would rather create a new extension, define the “string_position” wrapper and call “php_strpos” from there. Extending PHP is quite well explained at Zend Devzone. Google for “writing php extension”, there are few good articles. You can also find many examples in the “ext/” directory and on the PECL. I hope that answers your question.

]]>
By: Theodore R. Smith (PHP Experts, Inc.) http://systemsarchitect.net/hacking-php-syntax/#comment-591 Thu, 02 May 2013 03:34:35 +0000 http://systemsarchitect.net/?p=696#comment-591 What if I wanted to wanted to rename the function “strpos” to “string_position” and wanted to create an alias named “strpos”?

]]>