3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hello(float $a, float $b, float $c, float $d){ return $a+$b+$c+$d; } function hello2($a, $b, $c, $d){ return $a+$b+$c+$d; } function millis(){ return round(microtime(true) * 1000); } $a = array(1,2,3,4,"test"); $t = millis(); for($i=0;$i<500000;$i++){ hello($a[0],$a[1],$a[2],$a[3]); } echo("with types: " . (millis() -$t) . " ms\n"); $t = millis(); for($i=0;$i<500000;$i++){ hello2($a[0],$a[1],$a[2],$a[3]); } echo("without types: " . (millis() -$t) . " ms\n");
Output for 8.1.13
with types: 72 ms without types: 27 ms
Output for 8.1.12
with types: 78 ms without types: 30 ms
Output for 8.1.11
with types: 75 ms without types: 28 ms
Output for 8.1.10
with types: 72 ms without types: 26 ms
Output for 8.1.9
with types: 69 ms without types: 29 ms
Output for 8.1.8
with types: 79 ms without types: 29 ms
Output for 8.1.7
with types: 97 ms without types: 30 ms
Output for 8.1.6
with types: 85 ms without types: 39 ms
Output for 8.1.5
with types: 71 ms without types: 25 ms
Output for 8.1.4
with types: 87 ms without types: 41 ms
Output for 8.1.3
with types: 76 ms without types: 29 ms
Output for 7.4.0, 8.1.2
with types: 70 ms without types: 27 ms
Output for 8.1.1
with types: 86 ms without types: 28 ms
Output for 8.1.0
with types: 88 ms without types: 26 ms
Output for 8.0.26
with types: 77 ms without types: 28 ms
Output for 8.0.25
with types: 76 ms without types: 28 ms
Output for 8.0.24
with types: 78 ms without types: 26 ms
Output for 8.0.23
with types: 87 ms without types: 31 ms
Output for 8.0.22
with types: 105 ms without types: 35 ms
Output for 8.0.21
with types: 70 ms without types: 20 ms
Output for 8.0.20
with types: 65 ms without types: 20 ms
Output for 8.0.19
with types: 75 ms without types: 26 ms
Output for 8.0.18
with types: 86 ms without types: 31 ms
Output for 8.0.17
with types: 68 ms without types: 19 ms
Output for 8.0.16
with types: 83 ms without types: 30 ms
Output for 8.0.15
with types: 96 ms without types: 46 ms
Output for 8.0.14
with types: 89 ms without types: 40 ms
Output for 8.0.13
with types: 77 ms without types: 30 ms
Output for 7.4.27, 8.0.12
with types: 84 ms without types: 35 ms
Output for 8.0.11
with types: 85 ms without types: 30 ms
Output for 8.0.10
with types: 80 ms without types: 29 ms
Output for 8.0.9
with types: 98 ms without types: 35 ms
Output for 8.0.8
with types: 65 ms without types: 19 ms
Output for 8.0.7
with types: 68 ms without types: 20 ms
Output for 8.0.6
with types: 91 ms without types: 32 ms
Output for 8.0.5
with types: 89 ms without types: 32 ms
Output for 8.0.3
with types: 99 ms without types: 32 ms
Output for 8.0.2
with types: 84 ms without types: 19 ms
Output for 8.0.1
with types: 60 ms without types: 20 ms
Output for 8.0.0
with types: 62 ms without types: 20 ms
Output for 7.4.33
with types: 55 ms without types: 22 ms
Output for 7.4.32
with types: 58 ms without types: 20 ms
Output for 7.1.22, 7.4.30
with types: 81 ms without types: 35 ms
Output for 7.4.29
with types: 81 ms without types: 38 ms
Output for 7.4.28
with types: 82 ms without types: 34 ms
Output for 7.4.26
with types: 86 ms without types: 35 ms
Output for 7.4.25
with types: 83 ms without types: 34 ms
Output for 7.4.24
with types: 87 ms without types: 40 ms
Output for 7.4.23
with types: 63 ms without types: 28 ms
Output for 7.4.22
with types: 84 ms without types: 27 ms
Output for 7.1.19, 7.4.21
with types: 84 ms without types: 33 ms
Output for 7.4.20
with types: 96 ms without types: 34 ms
Output for 7.4.19
with types: 78 ms without types: 33 ms
Output for 7.4.18
with types: 87 ms without types: 37 ms
Output for 7.4.16
with types: 98 ms without types: 36 ms
Output for 7.4.15
with types: 94 ms without types: 42 ms
Output for 7.4.14
with types: 78 ms without types: 31 ms
Output for 7.4.13
with types: 74 ms without types: 34 ms
Output for 7.2.32, 7.3.17, 7.4.12
with types: 82 ms without types: 29 ms
Output for 7.4.11
with types: 68 ms without types: 32 ms
Output for 7.4.10
with types: 79 ms without types: 36 ms
Output for 7.3.11, 7.4.9
with types: 69 ms without types: 32 ms
Output for 7.4.8
with types: 110 ms without types: 30 ms
Output for 7.4.7
with types: 66 ms without types: 27 ms
Output for 7.4.6
with types: 74 ms without types: 25 ms
Output for 7.4.5
with types: 75 ms without types: 29 ms
Output for 7.4.4
with types: 74 ms without types: 29 ms
Output for 7.4.3
with types: 72 ms without types: 30 ms
Output for 7.4.2
with types: 81 ms without types: 28 ms
Output for 7.4.1
with types: 79 ms without types: 27 ms
Output for 7.3.33
with types: 69 ms without types: 36 ms
Output for 7.3.32
with types: 67 ms without types: 30 ms
Output for 7.3.31
with types: 65 ms without types: 27 ms
Output for 7.3.30
with types: 95 ms without types: 36 ms
Output for 7.3.29
with types: 88 ms without types: 29 ms
Output for 7.3.28
with types: 68 ms without types: 30 ms
Output for 7.3.27
with types: 69 ms without types: 31 ms
Output for 7.3.26
with types: 75 ms without types: 36 ms
Output for 7.3.25
with types: 71 ms without types: 29 ms
Output for 7.3.24
with types: 72 ms without types: 32 ms
Output for 7.3.23
with types: 78 ms without types: 34 ms
Output for 7.3.22
with types: 103 ms without types: 38 ms
Output for 7.3.21
with types: 73 ms without types: 62 ms
Output for 7.3.20
with types: 80 ms without types: 35 ms
Output for 7.3.19
with types: 60 ms without types: 32 ms
Output for 7.3.18
with types: 70 ms without types: 31 ms
Output for 7.3.16
with types: 64 ms without types: 28 ms
Output for 7.3.15
with types: 76 ms without types: 35 ms
Output for 7.3.14
with types: 92 ms without types: 33 ms
Output for 7.3.13
with types: 69 ms without types: 34 ms
Output for 7.3.12
with types: 79 ms without types: 42 ms
Output for 7.3.10
with types: 74 ms without types: 36 ms
Output for 7.3.9
with types: 81 ms without types: 29 ms
Output for 7.3.8
with types: 73 ms without types: 34 ms
Output for 7.3.7
with types: 88 ms without types: 32 ms
Output for 7.3.6
with types: 68 ms without types: 29 ms
Output for 7.3.5
with types: 73 ms without types: 32 ms
Output for 7.3.4
with types: 63 ms without types: 34 ms
Output for 7.3.3
with types: 68 ms without types: 26 ms
Output for 7.3.2
with types: 74 ms without types: 32 ms
Output for 7.3.1
with types: 80 ms without types: 39 ms
Output for 7.3.0
with types: 82 ms without types: 32 ms
Output for 7.2.34
with types: 74 ms without types: 31 ms
Output for 7.2.33
with types: 69 ms without types: 35 ms
Output for 7.2.31
with types: 80 ms without types: 41 ms
Output for 7.2.30
with types: 74 ms without types: 37 ms
Output for 7.2.29
with types: 84 ms without types: 32 ms
Output for 7.2.28
with types: 106 ms without types: 32 ms
Output for 7.2.27
with types: 72 ms without types: 34 ms
Output for 7.2.26
with types: 80 ms without types: 38 ms
Output for 7.2.25
with types: 110 ms without types: 48 ms
Output for 7.1.14, 7.2.24
with types: 71 ms without types: 38 ms
Output for 7.2.23
with types: 79 ms without types: 28 ms
Output for 7.2.22
with types: 64 ms without types: 22 ms
Output for 7.2.21
with types: 55 ms without types: 24 ms
Output for 7.2.20
with types: 53 ms without types: 24 ms
Output for 7.2.19
with types: 56 ms without types: 24 ms
Output for 7.2.18
with types: 57 ms without types: 23 ms
Output for 7.2.17
with types: 88 ms without types: 38 ms
Output for 7.2.16
with types: 91 ms without types: 39 ms
Output for 7.2.15
with types: 85 ms without types: 40 ms
Output for 7.2.14
with types: 89 ms without types: 41 ms
Output for 7.2.13
with types: 70 ms without types: 23 ms
Output for 7.2.12
with types: 57 ms without types: 28 ms
Output for 7.2.11
with types: 53 ms without types: 27 ms
Output for 7.2.10
with types: 57 ms without types: 26 ms
Output for 7.2.9
with types: 88 ms without types: 40 ms
Output for 7.2.7 - 7.2.8
with types: 87 ms without types: 39 ms
Output for 7.2.6
with types: 90 ms without types: 40 ms
Output for 7.2.5
with types: 79 ms without types: 34 ms
Output for 7.2.4
with types: 56 ms without types: 38 ms
Output for 7.2.3
with types: 61 ms without types: 25 ms
Output for 7.2.2
with types: 62 ms without types: 29 ms
Output for 7.2.1
with types: 85 ms without types: 28 ms
Output for 7.2.0
with types: 60 ms without types: 30 ms
Output for 7.1.33
with types: 66 ms without types: 34 ms
Output for 7.1.5, 7.1.32
with types: 64 ms without types: 33 ms
Output for 7.1.3, 7.1.31
with types: 67 ms without types: 33 ms
Output for 7.1.30
with types: 68 ms without types: 33 ms
Output for 7.1.29
with types: 78 ms without types: 46 ms
Output for 7.1.28
with types: 82 ms without types: 40 ms
Output for 7.1.27
with types: 70 ms without types: 34 ms
Output for 7.1.26
with types: 67 ms without types: 36 ms
Output for 7.1.25
with types: 95 ms without types: 50 ms
Output for 7.1.24
with types: 68 ms without types: 38 ms
Output for 7.1.23
with types: 83 ms without types: 35 ms
Output for 7.1.17, 7.1.21
with types: 69 ms without types: 33 ms
Output for 7.1.20
with types: 66 ms without types: 32 ms
Output for 7.1.18
with types: 85 ms without types: 43 ms
Output for 7.1.16
with types: 73 ms without types: 35 ms
Output for 7.1.15
with types: 78 ms without types: 37 ms
Output for 7.1.13
with types: 72 ms without types: 33 ms
Output for 7.1.9, 7.1.12
with types: 71 ms without types: 36 ms
Output for 7.1.11
with types: 62 ms without types: 32 ms
Output for 7.1.10
with types: 71 ms without types: 34 ms
Output for 7.1.8
with types: 73 ms without types: 37 ms
Output for 7.1.7
with types: 72 ms without types: 38 ms
Output for 7.1.1, 7.1.6
with types: 89 ms without types: 37 ms
Output for 7.1.4
with types: 75 ms without types: 35 ms
Output for 7.1.2
with types: 67 ms without types: 34 ms
Output for 7.1.0
with types: 74 ms without types: 38 ms
Output for 7.0.33
with types: 92 ms without types: 55 ms
Output for 7.0.32
with types: 92 ms without types: 57 ms
Output for 7.0.31
with types: 95 ms without types: 55 ms
Output for 7.0.30
with types: 94 ms without types: 52 ms
Output for 7.0.29
with types: 110 ms without types: 57 ms
Output for 7.0.28
with types: 89 ms without types: 57 ms
Output for 7.0.27
with types: 96 ms without types: 54 ms
Output for 7.0.26
with types: 111 ms without types: 63 ms
Output for 7.0.25
with types: 90 ms without types: 55 ms
Output for 7.0.0, 7.0.24
with types: 110 ms without types: 65 ms
Output for 7.0.23
with types: 87 ms without types: 52 ms
Output for 7.0.22
with types: 93 ms without types: 53 ms
Output for 7.0.21
with types: 100 ms without types: 53 ms
Output for 7.0.20
with types: 88 ms without types: 57 ms
Output for 7.0.19
with types: 93 ms without types: 55 ms
Output for 7.0.5, 7.0.18
with types: 84 ms without types: 54 ms
Output for 7.0.17
with types: 99 ms without types: 54 ms
Output for 7.0.16
with types: 94 ms without types: 51 ms
Output for 7.0.15
with types: 108 ms without types: 58 ms
Output for 7.0.14
with types: 91 ms without types: 56 ms
Output for 7.0.13
with types: 94 ms without types: 54 ms
Output for 7.0.12
with types: 105 ms without types: 54 ms
Output for 7.0.11
with types: 92 ms without types: 56 ms
Output for 7.0.10
with types: 108 ms without types: 66 ms
Output for 7.0.9
with types: 93 ms without types: 54 ms
Output for 7.0.8
with types: 99 ms without types: 53 ms
Output for 7.0.7
with types: 86 ms without types: 54 ms
Output for 7.0.6
with types: 98 ms without types: 57 ms
Output for 7.0.4
with types: 102 ms without types: 56 ms
Output for 7.0.3
with types: 98 ms without types: 58 ms
Output for 7.0.2
with types: 97 ms without types: 58 ms
Output for 7.0.1
with types: 112 ms without types: 66 ms
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Catchable fatal error: Argument 1 passed to hello() must be an instance of float, integer given, called in /in/chhCD on line 18 and defined in /in/chhCD on line 3
Process exited with code 255.

preferences:
192.84 ms | 402 KiB | 294 Q