3v4l.org

run code in 300+ PHP versions simultaneously
<?php function odd($var) { // retourne lorsque l'entrée est impaire return($var & 1); } function even($var) { // retourne lorsque l'entrée est paire return(!($var & 1)); } $array1 = array( 0 => 'a', 1 => 2, 2 => 4, 3 => 'd'); echo "Impair :\n"; print_r(array_filter($array1, "odd")); //echo "Pair :\n"; //print_r(array_filter($array2, "even"));
Output for git.master, git.master_jit, rfc.property-hooks
Impair : Fatal error: Uncaught TypeError: Unsupported operand types: string & int in /in/Bb2fK:6 Stack trace: #0 [internal function]: odd('a') #1 /in/Bb2fK(21): array_filter(Array, 'odd') #2 {main} thrown in /in/Bb2fK on line 6
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:
37.33 ms | 401 KiB | 8 Q