{"id":355,"date":"2009-03-05T20:38:37","date_gmt":"2009-03-05T18:38:37","guid":{"rendered":"http:\/\/patchlog.com\/?p=355"},"modified":"2009-02-28T20:44:20","modified_gmt":"2009-02-28T18:44:20","slug":"adding-new-php-syntax","status":"publish","type":"post","link":"https:\/\/patchlog.com\/patches\/adding-new-php-syntax\/","title":{"rendered":"Adding new php syntax"},"content":{"rendered":"<p>This is a quick patch I did to php's source code to implement some special syntax. Basically I wanted to be able to define an array like this:<\/p>\n<pre><ol><li style=\"font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;\"><div style=\"font-family: 'Courier New', Courier, monospace; font-weight: normal;\">&nbsp;<\/div><\/li><\/ol><\/pre>\n<p>Get the patch here:\u00c2\u00a0 [download#5]<br \/>\nTo get this behavior download php's source code, extract it put my patch in the source directory and\u00c2\u00a0 do this:<\/p>\n<pre><ol><li style=\"font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;\"><div style=\"font-family: 'Courier New', Courier, monospace; font-weight: normal;\">&nbsp;<\/div><\/li><\/ol><\/pre>\n<p>( This will only compile but not install - in case you want that just type make install at the end )<br \/>\nAnd here's a test script :<\/p>\n<pre><ol><li style=\"font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;\"><div style=\"font-family: 'Courier New', Courier, monospace; font-weight: normal;\">&nbsp;<\/div><\/li><\/ol><\/pre>\n<p>Save this script as test.php then run sapi\/cli\/php  test.php<\/p>\n<p>This was tested on php 5.2.6 and 5.2.9. I think this is probably useless for most people but it was fun to write so why not share it \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a quick patch I did to php&#8217;s source code to implement some special syntax. Basically I wanted to be able to define an array like this: &nbsp; Get the patch here:\u00c2\u00a0 [download#5] To get this behavior download php&#8217;s source code, extract it put my patch in the source directory and\u00c2\u00a0 do this: &nbsp; &hellip; <a href=\"https:\/\/patchlog.com\/patches\/adding-new-php-syntax\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Adding new php syntax<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[13],"tags":[244,94,356,243],"class_list":["post-355","post","type-post","status-publish","format-standard","hentry","category-patches","tag-array","tag-patch","tag-php","tag-syntax"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pofPh-5J","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts\/355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/comments?post=355"}],"version-history":[{"count":7,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts\/355\/revisions"}],"predecessor-version":[{"id":362,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/posts\/355\/revisions\/362"}],"wp:attachment":[{"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/media?parent=355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/categories?post=355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patchlog.com\/wp-json\/wp\/v2\/tags?post=355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}