3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class C1 {} interface I1 {} interface I2 {} $v2 = new class (100) extends C1 implements I1, I2 { public function __construct($p) { echo "Inside class " . __CLASS__ . " constructor with parameter $p\n"; } };
Output for 7.2.0
Inside class class@anonymous/in/qquP00x7f91d1f2d0da constructor with parameter 100
Output for 7.1.10
Inside class class@anonymous/in/qquP00x7fa99cad60da constructor with parameter 100
Output for 7.1.7
Inside class class@anonymous/in/qquP00x7f2ec89a80da constructor with parameter 100
Output for 7.1.6
Inside class class@anonymous/in/qquP00x7f38a3e8d0da constructor with parameter 100
Output for 7.1.5
Inside class class@anonymous/in/qquP00x7f2dc32650da constructor with parameter 100
Output for 7.1.0
Inside class class@anonymous/in/qquP00x7f9f56d790da constructor with parameter 100
Output for 7.0.20
Inside class class@anonymous/in/qquP00x7fc4b8ffc0da constructor with parameter 100
Output for 7.0.6
Inside class class@anonymous/in/qquP00x7f4ddbe1b0da constructor with parameter 100
Output for 7.0.5
Inside class class@anonymous/in/qquP00x7f5d299a80da constructor with parameter 100
Output for 7.0.4
Inside class class@anonymous/in/qquP00x7f3f03c3d0da constructor with parameter 100
Output for 7.0.3
Inside class class@anonymous/in/qquP00x7f0a42e5e0da constructor with parameter 100
Output for 7.0.2
Inside class class@anonymous/in/qquP00x7fc3b4e050da constructor with parameter 100
Output for 7.0.1
Inside class class@anonymous/in/qquP00x7f610ec2b0da constructor with parameter 100
Output for 7.0.0
Inside class class@anonymous/in/qquP00x7f97a324d0da constructor with parameter 100
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/qquP0 on line 6
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/qquP0 on line 6
Process exited with code 255.