3v4l.org

run code in 300+ PHP versions simultaneously
<?php $us_states = array( 'alabama', 'arkansas', 'california', 'colorado', 'connecticut', 'delaware', 'district_of_columbia', 'florida', 'georgia', 'hawaii', 'idaho', 'illinois', 'indiana', 'iowa', 'kansas', 'kentucky', 'louisiana', 'maine', 'maryland', 'massachusetts', 'michigan', 'minnesota', 'mississippi', 'missouri', 'montana', 'nebraska', 'nevada', 'new_hampshire', 'new_jersey', 'new_mexico', 'new_york', 'north_carolina', 'north_dakota', 'ohio', 'oklahoma', 'oregon', 'pennsylvania', 'rhode_island', 'south_carolina', 'south_dakota', 'tennessee', 'texas', 'utah', 'vermont', 'virginia', 'washington', 'west_virginia', 'wisconsin', 'wyoming' ); $us_states = array_map( function ( $val ) { $obj = new StdClass(); $obj->$val = $val; return $obj; }, $us_states ); // array_unshift( // array_map( // function ( $val ) { // $obj = new StdClass(); // $obj->$val = $val; // return $obj; // }, // $us_states // ), // new StdClass() // ); var_dump( array_merge( [new StdClass()], array_map( function ( $val ) { $obj = new StdClass(); $obj->$val = $val; return $obj; }, $us_states ), [new StdClass()] ) );
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in /in/Z8HdD:42 Stack trace: #0 [internal function]: {closure}(Object(stdClass)) #1 /in/Z8HdD(39): array_map(Object(Closure), Array) #2 {main} thrown in /in/Z8HdD on line 42
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:
39.49 ms | 401 KiB | 8 Q