3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Insurance{ function clsNAme(){ echo get_class($this); } } $cl = new Insurance(); $cl->clsName(); Insurance::clsName(); var_dump (3*4); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); $var = "testing module"; $statement = 'This is a $var'; echo ($statement); $var = "testing module"; $statement = "This is a $var"; echo ($statement); $arr = array("foo","bar","baz"); for ( $i = 0; $i < count($arr); $i++){ $item = $arr[$i]; } echo "<pre>"; print_r($item); echo "</pre>"; $a = 3; print '$a'; echo '$a'; print "$a"; echo "$a"; $array = array(array(141,151,161), 2, 3, array(101, 202, 303)); function DisplayArray($array) { foreach ($array as $value) { if (is_array($value)) { DisplayArray($value); } else { echo $value . " "; } } } DisplayArray($array); echo 0x10; ?>
based on v9bSV
Output for 7.1.0 - 7.2.0
Insurance Deprecated: Non-static method Insurance::clsNAme() should not be called statically in /in/uPFKo on line 11 Fatal error: Uncaught Error: Using $this when not in object context in /in/uPFKo:5 Stack trace: #0 /in/uPFKo(11): Insurance::clsNAme() #1 {main} thrown in /in/uPFKo on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Insurance Deprecated: Non-static method Insurance::clsNAme() should not be called statically in /in/uPFKo on line 11 Notice: Undefined variable: this in /in/uPFKo on line 5 Insuranceint(12) Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uPFKo:14 Stack trace: #0 {main} thrown in /in/uPFKo on line 14
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Insurance Strict Standards: Non-static method Insurance::clsNAme() should not be called statically in /in/uPFKo on line 11 Notice: Undefined variable: this in /in/uPFKo on line 5 Insuranceint(12) Fatal error: Call to undefined function curl_init() in /in/uPFKo on line 14
Process exited with code 255.