3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f(){} f(print "Jack\n"); $a=null; f(print ++$a . "\n"); print strlen(4) . "\n"; class C { function C(){} } new C(print ++$a); $a = 10; echo "\nCount: ",count($a),"\n"; $n=NULL; $nn = $n; --$nn; $n++; var_dump($nn,$n); $s = "mehea"; $s++; var_dump($s); $s--; var_dump($s); class A { } class B extends A { public function __construct() { // make sure parent constructor gets called if someone adds one parent::__construct(); } } new B();
Output for git.master, git.master_jit, rfc.property-hooks
Jack 1 1 2 Count: Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given in /in/bTsZK:13 Stack trace: #0 {main} thrown in /in/bTsZK on line 13
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:
46.54 ms | 401 KiB | 8 Q