3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Crear variable $Ryan y asignarle como valor la clase Usuario $Ryan = new Usuario(); // Ahora la variable Ryan es una clase, con variables $nombre y $edad $Ryan->AsignarNombre("Ryan"); $Ryan->AsignarEdad(19); //////////////////////////////////////////////// // Crear variable $Ismael y asignarle como valor la clase Usuario $Ismael = new Usuario(); // Ahora la variable Ismael es una clase, con variables $nombre y $edad $Ismael->AsignarNombre("Ismael"); $Ismael->AsignarEdad(21); ////////////////////// // Mostrar informacion de ryan $Ryan->MostrarDatos(); // Mostrar informacion de Ismael $Ismael->MostrarDatos(); Class Usuario{ public $nombre; public $edad; function AsignarNombre($nombre){ $this->nombre = $nombre; } function AsignarEdad($edad){ $this->edad = $edad; } function MostrarDatos(){ echo $this->nombre.' tiene '.$this->$edad.'\n'; } } ?>
based on IEnGQ

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0060.00616.86
7.2.00.0000.01419.16
7.1.200.0060.00915.85
7.1.100.0000.00918.04
7.1.70.0050.00216.84
7.1.60.0110.00419.12
7.1.50.0070.00716.92
7.1.00.0070.07322.26
7.0.200.0030.00616.63
7.0.60.0070.08719.94
7.0.50.0030.08317.93
7.0.40.0100.05720.41
7.0.30.0400.07320.21
7.0.20.0400.06720.10
7.0.10.0070.04020.06
7.0.00.0070.08320.20
5.6.280.0070.05321.11
5.6.210.0070.03720.57
5.6.200.0070.04718.20
5.6.190.0000.04720.64
5.6.180.0500.07020.39
5.6.170.0270.05020.71
5.6.160.0070.04720.57
5.6.150.0070.03318.19
5.6.140.0070.06718.23
5.6.130.0070.08018.21
5.6.120.0130.07321.00
5.6.110.0170.08021.05
5.6.100.0070.07020.98
5.6.90.0030.04321.14
5.6.80.0070.07320.43
5.5.350.4700.03320.42
5.5.340.0070.06317.95
5.5.330.0200.07320.29
5.5.320.0230.07720.35
5.5.310.0230.04020.30
5.5.300.0130.07717.98
5.5.290.0070.08017.99
5.5.280.0000.04720.81
5.5.270.0130.08020.89
5.5.260.0130.07720.68
5.5.250.0070.06320.71
5.5.240.0100.07020.18
5.4.450.0830.07319.70
5.4.440.0970.05719.60
5.4.430.0830.05719.47
5.4.420.0800.05719.62
5.4.410.1000.04719.25
5.4.400.0970.04719.06
5.4.390.0900.05719.23
5.4.380.1030.05319.15
5.4.370.1200.05319.01
5.4.360.0930.05719.27
5.4.350.0870.06319.38
5.4.340.1030.04319.29
5.4.320.0930.05019.11
5.4.310.1030.04019.13
5.4.300.0970.05319.28
5.4.290.0770.05019.07
5.4.280.0800.05019.22
5.4.270.0900.05719.37
5.4.260.0930.05018.98
5.4.250.0870.05319.13
5.4.240.0800.05019.27
5.4.230.0770.05019.09
5.4.220.1000.04718.96
5.4.210.0800.05319.35
5.4.200.0800.05016.71
5.4.190.1030.05719.02
5.4.180.0930.05719.25
5.4.170.0930.05019.14
5.4.160.0830.05719.09
5.4.150.0900.05719.34
5.4.140.0930.05316.49
5.4.130.1070.05316.32
5.4.120.0970.05716.39
5.4.110.0900.04716.45
5.4.100.0870.05316.33
5.4.90.0870.04016.32
5.4.80.0770.05316.53
5.4.70.0930.06016.49
5.4.60.1000.06716.56
5.4.50.0830.04016.40
5.4.40.0730.05016.32
5.4.30.0130.04316.39
5.4.20.0070.05316.28
5.4.10.0230.05016.48
5.4.00.0800.05015.89
5.3.290.0900.05014.75
5.3.280.0830.06014.75
5.3.270.0870.06314.63
5.3.260.0330.05714.64
5.3.250.0130.04714.52
5.3.240.0400.05014.63
5.3.230.0530.05714.69
5.3.220.0530.04714.66
5.3.210.0100.05314.48
5.3.200.0030.05714.59
5.3.190.0600.05314.43
5.3.180.0700.06014.80
5.3.170.0700.05314.63
5.3.160.1030.05714.63
5.3.150.0800.04714.48
5.3.140.0800.04714.62
5.3.130.0630.06714.47
5.3.120.0630.06014.46
5.3.110.0970.06014.78
5.3.100.0830.05714.05
5.3.90.0870.05314.17
5.3.80.1070.05014.07
5.3.70.1000.05314.07
5.3.60.1000.06013.94
5.3.50.1100.07313.81
5.3.40.1030.05713.96
5.3.30.1230.05313.93
5.3.20.1100.05013.70
5.3.10.1070.07713.71
5.3.00.1200.06313.87
5.2.170.0830.05011.06
5.2.160.0830.04311.06
5.2.150.0430.04311.22
5.2.140.0800.04311.18
5.2.130.0470.05011.34
5.2.120.0770.03711.01
5.2.110.0830.04010.97
5.2.100.0770.04311.01
5.2.90.0800.03711.02
5.2.80.0530.04311.34
5.2.70.0870.04711.03
5.2.60.0700.04311.20
5.2.50.0530.04310.93
5.2.40.0500.04710.87
5.2.30.0570.05310.99
5.2.20.0800.05010.83
5.2.10.0770.04010.95
5.2.00.0770.02710.88
5.1.60.0500.0409.98
5.1.50.0730.0379.91
5.1.40.0730.03310.21
5.1.30.0570.04010.35
5.1.20.0830.04310.32
5.1.10.0700.03010.06
5.1.00.0600.03710.00
5.0.50.0230.0338.48
5.0.40.0230.0338.35
5.0.30.0330.0378.28
5.0.20.0400.0338.09
5.0.10.0270.0378.23
5.0.00.0300.0408.07
4.4.90.0230.0236.97
4.4.80.0230.0236.97
4.4.70.0300.0336.97
4.4.60.0130.0276.97
4.4.50.0300.0206.97
4.4.40.0330.0376.97
4.4.30.0200.0276.97
4.4.20.0300.0236.97
4.4.10.0470.0106.97
4.4.00.0470.0306.97
4.3.110.0370.0206.97
4.3.100.0300.0176.97
4.3.90.0370.0106.97
4.3.80.0270.0336.97
4.3.70.0400.0276.97
4.3.60.0200.0276.97
4.3.50.0230.0236.97
4.3.40.0270.0376.97
4.3.30.0170.0206.97
4.3.20.0200.0206.97
4.3.10.0170.0206.97
4.3.00.0000.0237.24