3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = false; var_dump(count($a)); var_dump(reset($a)); $a = true; var_dump(count($a)); var_dump(reset($a)); $a = null; var_dump(count($a)); var_dump(reset($a)); $a = ''; var_dump(count($a)); var_dump(reset($a)); $a = 'string'; var_dump(count($a)); var_dump(reset($a));
Output for 8.3.0 - 8.3.29, 8.4.1 - 8.4.14, 8.4.16, 8.5.0 - 8.5.1
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in /in/nHrpA:4 Stack trace: #0 {main} thrown in /in/nHrpA on line 4
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.0.10 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /in/nHrpA:4 Stack trace: #0 {main} thrown in /in/nHrpA on line 4
Process exited with code 255.
Output for 8.0.0 - 8.0.9
Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, bool given in /in/nHrpA:4 Stack trace: #0 {main} thrown in /in/nHrpA on line 4
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 4 int(1) Warning: reset() expects parameter 1 to be array, bool given in /in/nHrpA on line 5 NULL Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 8 int(1) Warning: reset() expects parameter 1 to be array, bool given in /in/nHrpA on line 9 NULL Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 12 int(0) Warning: reset() expects parameter 1 to be array, null given in /in/nHrpA on line 13 NULL Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 16 int(1) Warning: reset() expects parameter 1 to be array, string given in /in/nHrpA on line 17 NULL Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 20 int(1) Warning: reset() expects parameter 1 to be array, string given in /in/nHrpA on line 21 NULL
Output for 7.2.0 - 7.2.33
Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 4 int(1) Warning: reset() expects parameter 1 to be array, boolean given in /in/nHrpA on line 5 NULL Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 8 int(1) Warning: reset() expects parameter 1 to be array, boolean given in /in/nHrpA on line 9 NULL Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 12 int(0) Warning: reset() expects parameter 1 to be array, null given in /in/nHrpA on line 13 NULL Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 16 int(1) Warning: reset() expects parameter 1 to be array, string given in /in/nHrpA on line 17 NULL Warning: count(): Parameter must be an array or an object that implements Countable in /in/nHrpA on line 20 int(1) Warning: reset() expects parameter 1 to be array, string given in /in/nHrpA on line 21 NULL
Output for 5.6.38 - 5.6.40, 7.0.33, 7.1.0 - 7.1.33
int(1) Warning: reset() expects parameter 1 to be array, boolean given in /in/nHrpA on line 5 NULL int(1) Warning: reset() expects parameter 1 to be array, boolean given in /in/nHrpA on line 9 NULL int(0) Warning: reset() expects parameter 1 to be array, null given in /in/nHrpA on line 13 NULL int(1) Warning: reset() expects parameter 1 to be array, string given in /in/nHrpA on line 17 NULL int(1) Warning: reset() expects parameter 1 to be array, string given in /in/nHrpA on line 21 NULL

preferences:
192.25 ms | 418 KiB | 5 Q