3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = json_encode(Array( Array("StartDate"=>"2014/07/31","LocZipCode"=>"19406","LocationURL"=>"FSU","EventType"=>"UN"), Array("StartDate"=>"2014/08/31","LocZipCode"=>"23513","LocationURL"=>"FSU","EventType"=>"UN"), Array("StartDate"=>"2014/07/31","LocZipCode"=>"92108","LocationURL"=>"BU","EventType"=>"UN"), Array("StartDate"=>"2014/09/30","LocZipCode"=>"78661","LocationURL"=>"BU","EventType"=>"UN") )); // even using a global variable doesn't // make it visible in getUniv() function global $univ_seg; $univ_seg = 'FSU'; getUA($data, $univ_seg); function getUniv($univ_seg){ return create_function('$a','return $a["EventType"] == "UN" && $a["LocationURL"] == ' . $univ_seg . ';'); } function getUA($data, $univ_seg) { $univ_sched = json_decode($data, true); $re = array_filter($univ_sched, getUniv($univ_seg)); print_r($re); }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function create_function() in /in/ub8C0:17 Stack trace: #0 /in/ub8C0(22): getUniv('FSU') #1 /in/ub8C0(14): getUA('[{"StartDate":"...', 'FSU') #2 {main} thrown in /in/ub8C0 on line 17
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
58.43 ms | 401 KiB | 8 Q