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 );
Output for 8.4.2
untyped: 0.01628s typed: 0.00907s Typed is -79% slower.
Output for 8.4.1
untyped: 0.01706s typed: 0.01126s Typed is -51% slower.
Output for 8.3.16
untyped: 0.01991s typed: 0.01055s Typed is -88% slower.
Output for 8.3.15
untyped: 0.02020s typed: 0.01818s Typed is -11% slower.
Output for 8.3.14
untyped: 0.02189s typed: 0.02266s Typed is 3% slower.
Output for 8.3.13
untyped: 0.00878s typed: 0.00912s Typed is 3% slower.
Output for 8.3.12
untyped: 0.00897s typed: 0.00911s Typed is 1% slower.
Output for 8.3.11
untyped: 0.00972s typed: 0.01112s Typed is 12% slower.
Output for 8.3.10
untyped: 0.00887s typed: 0.01017s Typed is 12% slower.
Output for 8.3.9
untyped: 0.01711s typed: 0.01406s Typed is -21% slower.
Output for 8.3.8
untyped: 0.01079s typed: 0.01241s Typed is 13% slower.
Output for 8.3.7
untyped: 0.02422s typed: 0.02533s Typed is 4% slower.
Output for 8.3.6
untyped: 0.02424s typed: 0.02359s Typed is -2% slower.
Output for 8.3.5
untyped: 0.02374s typed: 0.02309s Typed is -2% slower.
Output for 8.3.4
untyped: 0.01654s typed: 0.01690s Typed is 2% slower.
Output for 8.3.3
untyped: 0.01650s typed: 0.01675s Typed is 1% slower.
Output for 8.3.2
untyped: 0.00859s typed: 0.01032s Typed is 16% slower.
Output for 8.3.1
untyped: 0.00953s typed: 0.01006s Typed is 5% slower.
Output for 8.3.0
untyped: 0.00843s typed: 0.00899s Typed is 6% slower.
Output for 8.2.27
untyped: 0.00839s typed: 0.00924s Typed is 9% slower.
Output for 8.2.26
untyped: 0.02471s typed: 0.01622s Typed is -52% slower.
Output for 8.2.25
untyped: 0.00858s typed: 0.00917s Typed is 6% slower.
Output for 8.2.24
untyped: 0.00950s typed: 0.01128s Typed is 15% slower.
Output for 8.2.23
untyped: 0.01924s typed: 0.01818s Typed is -5% slower.
Output for 8.2.22
untyped: 0.00988s typed: 0.01092s Typed is 9% slower.
Output for 8.2.21
untyped: 0.01839s typed: 0.00996s Typed is -84% slower.
Output for 8.2.20
untyped: 0.01109s typed: 0.01314s Typed is 15% slower.
Output for 8.2.19
untyped: 0.01678s typed: 0.01771s Typed is 5% slower.
Output for 8.2.18
untyped: 0.01657s typed: 0.01918s Typed is 13% slower.
Output for 8.2.17
untyped: 0.02511s typed: 0.02680s Typed is 6% slower.
Output for 8.2.16
untyped: 0.01717s typed: 0.01776s Typed is 3% slower.
Output for 8.2.15
untyped: 0.00873s typed: 0.00921s Typed is 5% slower.
Output for 8.2.14
untyped: 0.00829s typed: 0.00922s Typed is 10% slower.
Output for 8.2.13
untyped: 0.00914s typed: 0.00998s Typed is 8% slower.
Output for 8.2.12
untyped: 0.00869s typed: 0.00908s Typed is 4% slower.
Output for 8.2.11
untyped: 0.02085s typed: 0.02031s Typed is -2% slower.
Output for 8.2.10
untyped: 0.01404s typed: 0.01417s Typed is 0% slower.
Output for 8.2.9
untyped: 0.01308s typed: 0.01398s Typed is 6% slower.
Output for 8.2.8
untyped: 0.01309s typed: 0.01421s Typed is 7% slower.
Output for 8.2.7
untyped: 0.01316s typed: 0.01450s Typed is 9% slower.
Output for 8.2.6
untyped: 0.01640s typed: 0.01778s Typed is 7% slower.
Output for 8.2.5
untyped: 0.01297s typed: 0.01419s Typed is 8% slower.
Output for 8.2.4
untyped: 0.01294s typed: 0.01415s Typed is 8% slower.
Output for 8.2.3
untyped: 0.01248s typed: 0.01398s Typed is 10% slower.
Output for 8.2.2
untyped: 0.01267s typed: 0.01392s Typed is 8% slower.
Output for 8.2.1
untyped: 0.01270s typed: 0.01409s Typed is 9% slower.
Output for 8.2.0
untyped: 0.01261s typed: 0.01394s Typed is 9% slower.
Output for 8.1.31
untyped: 0.00876s typed: 0.00926s Typed is 5% slower.
Output for 8.1.30
untyped: 0.00896s typed: 0.00947s Typed is 5% slower.
Output for 8.1.29
untyped: 0.01042s typed: 0.01098s Typed is 5% slower.
Output for 8.1.28
untyped: 0.02246s typed: 0.02163s Typed is -3% slower.
Output for 8.1.27
untyped: 0.00885s typed: 0.00895s Typed is 1% slower.
Output for 8.1.26
untyped: 0.00858s typed: 0.00915s Typed is 6% slower.
Output for 8.1.25
untyped: 0.00917s typed: 0.00908s Typed is 0% slower.
Output for 8.1.24
untyped: 0.02087s typed: 0.02050s Typed is -1% slower.
Output for 8.1.23
untyped: 0.01376s typed: 0.01425s Typed is 3% slower.
Output for 8.1.22
untyped: 0.01281s typed: 0.01421s Typed is 9% slower.
Output for 8.1.21
untyped: 0.01286s typed: 0.01356s Typed is 5% slower.
Output for 8.1.20
untyped: 0.01974s typed: 0.02058s Typed is 4% slower.
Output for 8.1.19
untyped: 0.01293s typed: 0.01431s Typed is 9% slower.
Output for 8.1.18
untyped: 0.01492s typed: 0.01600s Typed is 6% slower.
Output for 8.1.17
untyped: 0.01267s typed: 0.01439s Typed is 11% slower.
Output for 8.1.16
untyped: 0.01263s typed: 0.01324s Typed is 4% slower.
Output for 8.1.15
untyped: 0.01268s typed: 0.01356s Typed is 6% slower.
Output for 8.1.14
untyped: 0.01299s typed: 0.01350s Typed is 3% slower.
Output for 8.1.13
untyped: 0.01261s typed: 0.01352s Typed is 6% slower.
Output for 8.1.12
untyped: 0.01285s typed: 0.01395s Typed is 7% slower.
Output for 8.1.11
untyped: 0.01276s typed: 0.01352s Typed is 5% slower.
Output for 8.1.10
untyped: 0.01276s typed: 0.01364s Typed is 6% slower.
Output for 8.1.9
untyped: 0.01254s typed: 0.01360s Typed is 7% slower.
Output for 8.1.8
untyped: 0.01371s typed: 0.01349s Typed is -1% slower.
Output for 8.1.7
untyped: 0.01397s typed: 0.01366s Typed is -2% slower.
Output for 8.1.6
untyped: 0.01262s typed: 0.01360s Typed is 7% slower.
Output for 8.1.5
untyped: 0.01279s typed: 0.01351s Typed is 5% slower.
Output for 8.1.4
untyped: 0.01263s typed: 0.01363s Typed is 7% slower.
Output for 8.1.3
untyped: 0.01268s typed: 0.01344s Typed is 5% slower.
Output for 8.1.2
untyped: 0.01258s typed: 0.01374s Typed is 8% slower.
Output for 8.0.9, 8.1.1
untyped: 0.01265s typed: 0.01378s Typed is 8% slower.
Output for 8.1.0
untyped: 0.01278s typed: 0.01405s Typed is 9% slower.
Output for 8.0.30
untyped: 0.01289s typed: 0.01401s Typed is 7% slower.
Output for 8.0.29
untyped: 0.01295s typed: 0.01414s Typed is 8% slower.
Output for 8.0.28
untyped: 0.01278s typed: 0.01392s Typed is 8% slower.
Output for 8.0.27
untyped: 0.01277s typed: 0.01401s Typed is 8% slower.
Output for 8.0.26
untyped: 0.01281s typed: 0.01485s Typed is 13% slower.
Output for 8.0.25
untyped: 0.01307s typed: 0.01437s Typed is 9% slower.
Output for 8.0.24
untyped: 0.01275s typed: 0.01398s Typed is 8% slower.
Output for 8.0.23
untyped: 0.01285s typed: 0.01397s Typed is 8% slower.
Output for 8.0.22
untyped: 0.01320s typed: 0.01394s Typed is 5% slower.
Output for 8.0.21
untyped: 0.02252s typed: 0.01393s Typed is -61% slower.
Output for 8.0.20
untyped: 0.01279s typed: 0.01399s Typed is 8% slower.
Output for 8.0.19
untyped: 0.01281s typed: 0.01375s Typed is 6% slower.
Output for 8.0.18
untyped: 0.01286s typed: 0.01398s Typed is 8% slower.
Output for 8.0.17
untyped: 0.01280s typed: 0.01400s Typed is 8% slower.
Output for 8.0.16
untyped: 0.01299s typed: 0.01371s Typed is 5% slower.
Output for 8.0.15
untyped: 0.01252s typed: 0.01389s Typed is 9% slower.
Output for 8.0.14
untyped: 0.01380s typed: 0.01395s Typed is 1% slower.
Output for 8.0.13
untyped: 0.01256s typed: 0.01402s Typed is 10% slower.
Output for 8.0.12
untyped: 0.01269s typed: 0.01371s Typed is 7% slower.
Output for 8.0.11
untyped: 0.01260s typed: 0.01386s Typed is 9% slower.
Output for 8.0.10
untyped: 0.01260s typed: 0.01388s Typed is 9% slower.
Output for 8.0.8
untyped: 0.01261s typed: 0.01380s Typed is 8% slower.
Output for 8.0.7
untyped: 0.01291s typed: 0.01382s Typed is 6% slower.
Output for 8.0.6
untyped: 0.01259s typed: 0.01379s Typed is 8% slower.
Output for 8.0.5
untyped: 0.01260s typed: 0.01385s Typed is 9% slower.
Output for 8.0.3
untyped: 0.01287s typed: 0.01380s Typed is 6% slower.
Output for 8.0.2
untyped: 0.01267s typed: 0.01367s Typed is 7% slower.
Output for 8.0.1
untyped: 0.01286s typed: 0.01384s Typed is 7% slower.
Output for 7.4.33
untyped: 0.01340s typed: 0.01568s Typed is 14% slower.
Output for 7.4.32
untyped: 0.01350s typed: 0.01559s Typed is 13% slower.
Output for 7.4.30
untyped: 0.01345s typed: 0.01570s Typed is 14% slower.
Output for 7.4.29
untyped: 0.01369s typed: 0.01559s Typed is 12% slower.
Output for 7.4.28
untyped: 0.01409s typed: 0.01561s Typed is 9% slower.
Output for 7.4.27
untyped: 0.01386s typed: 0.01560s Typed is 11% slower.
Output for 7.4.26
untyped: 0.01397s typed: 0.01555s Typed is 10% slower.
Output for 7.4.25
untyped: 0.01395s typed: 0.01555s Typed is 10% slower.
Output for 7.4.24
untyped: 0.01399s typed: 0.01557s Typed is 10% slower.
Output for 7.4.23
untyped: 0.01414s typed: 0.01552s Typed is 8% slower.
Output for 7.4.22
untyped: 0.01341s typed: 0.01550s Typed is 13% slower.
Output for 7.4.21
untyped: 0.01361s typed: 0.01559s Typed is 12% slower.
Output for 7.4.20
untyped: 0.01347s typed: 0.01558s Typed is 13% slower.
Output for 7.4.19
untyped: 0.01349s typed: 0.01568s Typed is 13% slower.
Output for 7.4.18
untyped: 0.01340s typed: 0.01556s Typed is 13% slower.
Output for 7.4.16
untyped: 0.01348s typed: 0.01561s Typed is 13% slower.
Output for 7.4.15
untyped: 0.01348s typed: 0.01568s Typed is 14% slower.
Output for 7.4.14
untyped: 0.01355s typed: 0.01598s Typed is 15% slower.
Output for 7.4.13
untyped: 0.01334s typed: 0.01575s Typed is 15% slower.
Output for 7.4.12
untyped: 0.01335s typed: 0.01570s Typed is 14% slower.
Output for 7.4.11
untyped: 0.01346s typed: 0.01561s Typed is 13% slower.
Output for 7.4.10
untyped: 0.01341s typed: 0.01571s Typed is 14% slower.
Output for 7.4.9
untyped: 0.01342s typed: 0.01551s Typed is 13% slower.
Output for 7.4.8
untyped: 0.01340s typed: 0.01554s Typed is 13% slower.
Output for 7.4.7
untyped: 0.01345s typed: 0.01566s Typed is 14% slower.
Output for 7.4.6
untyped: 0.01355s typed: 0.01574s Typed is 13% slower.
Output for 7.4.5
untyped: 0.01339s typed: 0.01580s Typed is 15% slower.
Output for 7.4.4
untyped: 0.01339s typed: 0.01557s Typed is 14% slower.
Output for 7.4.3
untyped: 0.01333s typed: 0.01579s Typed is 15% slower.
Output for 7.4.2
untyped: 0.01353s typed: 0.01551s Typed is 12% slower.
Output for 7.4.1
untyped: 0.01472s typed: 0.01544s Typed is 4% slower.
Output for 7.4.0
untyped: 0.01341s typed: 0.01552s Typed is 13% slower.

preferences:
115.07 ms | 607 KiB | 5 Q