3v4l.org

run code in 300+ PHP versions simultaneously
<?php function renderTemplate($templateText, array $data, $allRequired = false) { return preg_replace_callback(self::VARIABLE_FORMAT, function ($match) use ($data, $allRequired) { $original = $match[0]; $name = $match['name']; $value = data_get($data, $name, function () use ($allRequired, $name, $original) { if ($allRequired) { throw new TemplateDataNotSetException("Template data '$name' not set and could not be resolved"); } else { return $original; } }); return (string) $value; }, $templateText); } renderTemplate('Podmínky Smlouvy o půjčku Výchozí text smlouvy. Jméno: {client.firstname} Příjmení: {client.lastname}', ['client' => ['firstname' => 'aaaaaaaaa']]);

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)
5.4.390.0500.05319.19
5.4.380.0200.05718.71
5.4.370.0200.05318.69
5.4.360.0130.06018.71
5.4.350.0200.05318.75
5.4.340.0300.04718.69
5.4.320.0130.06318.56
5.4.310.0300.04718.64
5.4.300.0230.05318.69
5.4.290.0230.05018.57
5.4.280.0270.05018.52
5.4.270.0200.05318.70
5.4.260.0170.05718.47
5.4.250.0200.05318.66
5.4.240.0130.06018.67
5.4.230.0330.06318.59
5.4.220.0200.05318.56
5.4.210.0200.05718.52
5.4.200.0330.04316.69
5.4.190.0230.06718.51
5.4.180.0300.04718.70
5.4.170.0230.05318.71
5.4.160.0270.05018.70
5.4.150.0270.06318.47
5.4.140.0170.06016.24
5.4.130.0270.07016.22
5.4.120.0130.05716.31
5.4.110.0170.05316.22
5.4.100.0330.06016.30
5.4.90.0300.06316.29
5.4.80.0170.05316.22
5.4.70.0270.04716.24
5.4.60.0100.06016.22
5.4.50.0300.06016.27
5.4.40.0300.04316.27
5.4.30.0330.04016.21
5.4.20.0230.05016.41
5.4.10.0200.05016.18
5.4.00.0330.06015.67
5.3.290.0200.05314.73
5.3.280.0270.05714.82
5.3.270.0270.05014.67
5.3.260.0230.06014.67
5.3.250.0230.05014.74
5.3.240.0270.04714.63
5.3.230.0300.04314.63
5.3.220.0230.05014.61
5.3.210.0270.05014.60
5.3.200.0170.05314.80
5.3.190.0330.03714.75
5.3.180.0130.05714.63
5.3.170.0100.06014.75
5.3.160.0170.05314.71
5.3.150.0170.05314.61
5.3.140.0230.06714.61
5.3.130.0300.05314.74
5.3.120.0300.04714.76
5.3.110.0200.06014.58
5.3.100.0230.05314.23
5.3.90.0230.05014.14
5.3.80.0170.05314.05
5.3.70.0270.05014.07
5.3.60.0270.04714.00
5.3.50.0230.05014.07
5.3.40.0170.05714.04
5.3.30.0170.05713.97
5.3.20.0230.05713.83
5.3.10.0370.05713.67
5.3.00.0430.05313.70
5.2.170.0300.05011.26
5.2.160.0230.06011.20
5.2.150.0200.04011.24
5.2.140.0200.04011.18
5.2.130.0170.04011.15
5.2.120.0170.04311.07
5.2.110.0130.04311.21
5.2.100.0130.04011.14
5.2.90.0170.04011.16
5.2.80.0330.02711.12
5.2.70.0270.03711.11
5.2.60.0100.05711.25
5.2.50.0130.04711.11
5.2.40.0200.05011.03
5.2.30.0170.05311.06
5.2.20.0130.04311.07
5.2.10.0130.04010.94
5.2.00.0200.03710.75
5.1.60.0370.03310.20
5.1.50.0170.04710.02
5.1.40.0130.03710.02
5.1.30.0170.03710.34
5.1.20.0130.03710.53
5.1.10.0130.03310.27
5.1.00.0200.03010.10
5.0.50.0030.0378.58
5.0.40.0200.0238.41
5.0.30.0170.0378.35
5.0.20.0130.0308.40
5.0.10.0200.0208.24
5.0.00.0100.0438.18
4.4.90.0070.0235.92
4.4.80.0100.0235.88
4.4.70.0100.0205.93
4.4.60.0100.0205.91
4.4.50.0100.0205.92
4.4.40.0100.0335.88
4.4.30.0070.0235.90
4.4.20.0200.0275.94
4.4.10.0070.0236.02
4.4.00.0070.0375.93
4.3.110.0030.0275.83
4.3.100.0030.0275.84
4.3.90.0000.0275.86
4.3.80.0070.0335.78
4.3.70.0030.0235.85
4.3.60.0070.0235.78
4.3.50.0070.0235.84
4.3.40.0070.0375.76
4.3.30.0070.0204.66
4.3.20.0030.0234.64
4.3.10.0030.0234.52
4.3.00.0130.0207.61

preferences:
144.08 ms | 1394 KiB | 7 Q