3v4l.org

run code in 300+ PHP versions simultaneously
<?php // start engines; for($i=0;$i++<2;)number_format(hrtime(true),5);test_1('hi');test_2('hi'); function test_1( $string ) {} function test_2( string $string ) {} $t = hrtime(true); for ( $i = 0; ++$i < 1e6; ) test_1( 'hi' ); echo 'untyped: ', $a=number_format( (hrtime(true)-$t)/1e9,5),"s\n"; $t = hrtime(true); for ( $i = 0; ++$i < 1e6; ) test_2( 'hi' ); echo 'typed: ', $b=number_format( (hrtime(true)-$t)/1e9,5),"s\n"; printf( 'Typed is %d%% slower.', (1-($a/$b))*100 );

preferences:
84.31 ms | 406 KiB | 5 Q