3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Voer volgende oefeningen uit. Schrijf je code steeds tussen: * //-- start -- en * * //-- stop -- * * Alle geschreven code mag niet worden gewijzigd. Je antwoorden worden automatisch gevalideerd. */ $families = [ ['man' => 'Ignace', 'vrouw' => 'Caroline', 'kinderen' => ['Matteo']], ['man' => 'Bart', 'vrouw' => 'Trees', 'kinderen' => ['Jarno', 'Tibaut', 'Emiel']], ]; // 1. toon alle mannen op het scherm met behulp van een foreach: ob_start(); // -- start -- // -- stop -- toonResultaatOefening(ob_get_clean(), "Ignace\nBart\n"); // 2. toon volgende tekst op het scherm met behulp van een foreach: // // Ignace en Caroline hebben 1 kind(eren) // Bart en Trees hebben 3 kind(eren) // // http://php.net/count -- count() telt het aantal elementen in een array ob_start(); // -- start -- // -- stop -- toonResultaatOefening(ob_get_clean(), "Ignace en Caroline hebben 1 kind(eren)\nBart en Trees hebben 3 kind(eren)\n"); // 3. Verander de waarde van $a, $b of beide zodat onderstaande oefening juist is: // -- start -- $a = false; $b = false; // -- stop -- toonResultaatOefening($a xor $b || $a && $b, true); // -- einde -- function toonResultaatOefening($output, $verwacht) { static $nummer; if (null === $nummer) { $nummer = 1; } else { $nummer += 1; } echo $output, PHP_EOL; echo 'Oefening #', $nummer, ' is ', ($output === $verwacht ? 'juist' : 'fout'), PHP_EOL, PHP_EOL; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.10.0070.01319.45
8.3.140.0160.00019.18
8.3.130.0040.00418.24
8.3.120.0040.00418.94
8.3.110.0080.00020.94
8.3.100.0090.00024.06
8.3.90.0040.01126.77
8.3.80.0100.00018.55
8.3.70.0060.00916.50
8.3.60.0100.01016.38
8.3.50.0080.01021.91
8.3.40.0030.01218.87
8.3.30.0140.00018.67
8.3.20.0000.00720.16
8.3.10.0050.00321.73
8.3.00.0030.00522.46
8.2.260.0090.00916.29
8.2.250.0070.00318.57
8.2.240.0090.00017.13
8.2.230.0110.00022.58
8.2.220.0040.00437.54
8.2.210.0040.00426.77
8.2.200.0090.00016.50
8.2.190.0110.00716.58
8.2.180.0140.00718.54
8.2.170.0070.00722.96
8.2.160.0070.01322.26
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00422.02
8.2.120.0040.00426.35
8.2.110.0090.00020.42
8.2.100.0080.00417.84
8.2.90.0090.00017.91
8.2.80.0060.00318.16
8.2.70.0000.00817.63
8.2.60.0000.00817.63
8.2.50.0030.00618.10
8.2.40.0040.00420.35
8.2.30.0000.00819.33
8.2.20.0070.00017.68
8.2.10.0000.00817.95
8.2.00.0040.00417.57
8.1.310.0000.00816.75
8.1.300.0120.00617.87
8.1.290.0090.00030.84
8.1.280.0070.00725.92
8.1.270.0060.00323.66
8.1.260.0030.00628.09
8.1.250.0040.00428.09
8.1.240.0030.00623.97
8.1.230.0080.00420.97
8.1.220.0060.00317.74
8.1.210.0030.00518.84
8.1.200.0040.00417.22
8.1.190.0090.00317.10
8.1.180.0040.00418.10
8.1.170.0030.00518.79
8.1.160.0070.00022.07
8.1.150.0000.00718.95
8.1.140.0000.00819.62
8.1.130.0030.00317.77
8.1.120.0040.00417.51
8.1.110.0050.00317.44
8.1.100.0040.00417.49
8.1.90.0000.00817.35
8.1.80.0020.00517.48
8.1.70.0070.00017.44
8.1.60.0050.00317.61
8.1.50.0000.00817.59
8.1.40.0000.00817.54
8.1.30.0080.00017.68
8.1.20.0040.00417.67
8.1.10.0000.00817.55
8.1.00.0030.00617.44
8.0.300.0040.00420.08
8.0.290.0040.00416.63
8.0.280.0070.00018.46
8.0.270.0070.00017.26
8.0.260.0030.00317.30
8.0.250.0000.00616.95
8.0.240.0030.00516.93
8.0.230.0030.00316.93
8.0.220.0000.00816.93
8.0.210.0000.00716.93
8.0.200.0030.00316.83
8.0.190.0040.00416.88
8.0.180.0000.00816.88
8.0.170.0040.00416.86
8.0.160.0070.00016.81
8.0.150.0000.00716.89
8.0.140.0040.00316.82
8.0.130.0030.00313.31
8.0.120.0040.00416.94
8.0.110.0030.00516.95
8.0.100.0020.00516.86
8.0.90.0040.00416.78
8.0.80.0040.01116.91
8.0.70.0070.00016.87
8.0.60.0040.00416.81
8.0.50.0070.00016.87
8.0.30.0090.00916.92
8.0.20.0080.01117.41
8.0.10.0040.00417.07
8.0.00.0060.01516.82
7.4.330.0000.00516.66
7.4.320.0030.00316.51
7.4.300.0030.00316.43
7.4.290.0030.00316.52
7.4.280.0080.00016.52
7.4.270.0000.00716.61
7.4.260.0050.00516.54
7.4.250.0040.00416.46
7.4.240.0040.00416.64
7.4.230.0030.00316.51
7.4.220.0090.00916.55
7.4.210.0090.00616.65
7.4.200.0050.00316.52
7.4.160.0050.01116.53
7.4.150.0090.01417.40
7.4.140.0230.01017.86
7.4.130.0080.00916.57
7.4.120.0130.00416.55
7.4.110.0110.00616.60
7.4.100.0080.00816.45
7.4.90.0000.01716.47
7.4.80.0100.01319.39
7.4.70.0080.00816.45
7.4.60.0090.00616.43
7.4.50.0120.00316.52
7.4.40.0040.01416.49
7.4.30.0050.01316.27
7.4.00.0090.00314.82
7.3.330.0030.00313.36
7.3.320.0000.00613.29
7.3.310.0040.00416.36
7.3.300.0000.00616.42
7.3.290.0110.00416.39
7.3.280.0060.01316.40
7.3.270.0130.01017.40
7.3.260.0120.00516.43
7.3.250.0090.01016.36
7.3.240.0120.00916.51
7.3.230.0070.01016.64
7.3.210.0060.01016.30
7.3.200.0070.01116.55
7.3.190.0040.01416.66
7.3.180.0030.01316.58
7.3.170.0120.01016.45
7.3.160.0030.01316.53
7.2.330.0110.00716.43
7.2.320.0170.00016.82
7.2.310.0160.00616.76
7.2.300.0070.01416.80
7.2.290.0060.01216.36
7.2.60.0070.00716.68
7.2.00.0030.01019.46
7.1.200.0060.00615.85
7.1.70.0070.00316.95
7.1.60.0040.00717.25
7.1.00.0070.07022.36
7.0.200.0110.00414.89
7.0.110.0230.06719.91
7.0.101.0100.04319.98
7.0.90.0300.06020.01
7.0.80.0300.06719.87
7.0.70.0270.07019.86
7.0.60.0230.06019.97
7.0.50.0600.05320.19
7.0.40.0230.06020.48
7.0.30.0230.06320.36
7.0.20.0300.05720.45
7.0.10.0330.05020.25
7.0.00.0370.05720.46
5.6.260.0130.05020.51
5.6.250.0100.05320.58
5.6.240.0170.06020.48
5.6.230.0200.04720.86
5.6.220.0070.05720.68
5.6.210.0100.05320.68
5.6.200.0070.06321.05
5.6.190.0130.05021.07
5.6.180.0070.05720.92
5.6.170.0100.05721.14
5.6.160.0000.06321.19
5.6.150.0070.07021.20
5.6.140.0130.05021.21
5.6.130.0130.05321.22
5.6.120.0100.05721.27
5.6.110.0000.06720.85
5.6.100.0100.05721.07
5.6.90.0100.06020.93
5.6.80.0100.05320.59
5.6.70.0030.06320.61
5.6.60.0030.05720.22
5.6.50.0130.05020.46
5.6.40.0170.04720.41
5.6.30.0170.04720.18
5.6.20.0100.05320.62
5.6.10.0130.05020.54
5.6.00.0100.05320.33

preferences:
28.83 ms | 403 KiB | 5 Q