3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array( 'ua' => array( 'family', 'major' ), 'os' => array( 'family', 'major' ) ); $result = new StdClass(); $result->ua->family = "Safari"; $result->ua->major = "6"; $result->ua->minor = "0"; $result->ua->patch = "2"; $result->ua->toString() = "Safari 6.0.2"; $result->ua->toVersion() = "6.0.2"; $result->os->family = "Mac OS X"; $result->os->major = "10"; $result->os->minor = "7"; $result->os->patch = "5"; $result->os->patchMinor = "[null]"; $result->os->toString() = "Mac OS X 10.7.5"; $result->os->toVersion() = "10.7.5"; array_intersect_key( (array) $result, $data );
Output for 5.0.0 - 5.4.26
Fatal error: Can't use method return value in write context in /in/lTYuC on line 11
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '=' in /in/lTYuC on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '=' in /in/lTYuC on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/lTYuC on line 11
Process exited with code 255.