3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $s = '3.14'; $i = 1; $numberRegex = '/-?(?:0|[1-9][0-9]*+)(?:\.[0-9]*+)?(?:[Ee][+-]?[0-9]+)?/A'; if ( preg_match( $numberRegex, $s, $matches, 0, --$i ) ) { $i += strlen( $matches[0] ); return array( 's', $this->decodeNumber( $matches[0] ) ); }
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught Error: Using $this when not in object context in /in/X0GSR:9 Stack trace: #0 {main} thrown in /in/X0GSR on line 9
Process exited with code 255.
Output for hhvm-3.20.2, hhvm-3.22.0
Fatal error: Uncaught Error: $this is null in /in/X0GSR:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.11.1 - 3.19.2, hhvm-3.21.0 - 3.21.3
Fatal error: Uncaught Error: $this is null in /in/X0GSR:9 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Fatal error: $this is null in /in/X0GSR on line 9
Process exited with code 255.
Output for 5.0.0 - 5.6.38
Fatal error: Using $this when not in object context in /in/X0GSR on line 9
Process exited with code 255.
Output for 4.3.3 - 4.4.9
Fatal error: Call to a member function on a non-object in /in/X0GSR on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.2
Warning: Wrong parameter count for preg_match() in /in/X0GSR on line 7