3v4l.org

run code in 200+ php & hhvm versions
<?php require __DIR__ . '/ticket/autoload.php'; //Nota: si renombraste la carpeta a algo diferente de "ticket" cambia el nombre en esta línea use Mike42\Escpos\Printer; use Mike42\Escpos\EscposImage; use Mike42\Escpos\PrintConnectors\WindowsPrintConnector; /* Este ejemplo imprime un hola mundo en una impresora de tickets en Windows. La impresora debe estar instalada como genérica y debe estar compartida */ /* Conectamos con la impresora */ /* Aquí, en lugar de "POS-58" (que es el nombre de mi impresora) escribe el nombre de la tuya. Recuerda que debes compartirla desde el panel de control */ $nombre_impresora = "POS-58"; $connector = new WindowsPrintConnector($nombre_impresora); $printer = new Printer($connector); /* Imprimimos un mensaje. Podemos usar el salto de línea o llamar muchas veces a $printer->text() */ $printer->text("Hola mundo\nParzibyte.me"); /* Hacemos que el papel salga. Es como dejar muchos saltos de línea sin escribir nada */ $printer->feed(); /* Cortamos el papel. Si nuestra impresora no tiene soporte para ello, no generará ningún error */ $printer->cut(); /* Por medio de la impresora mandamos un pulso. Esto es útil cuando la tenemos conectada por ejemplo a un cajón */ $printer->pulse(); /* Para imprimir realmente, tenemos que "cerrar" la conexión con la impresora. Recuerda incluir esto al final de todos los archivos */ $printer->close(); ?>

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.3.10.0040.00816.42
7.3.00.0000.01616.70
7.2.130.0070.00716.53
7.2.120.0070.00316.51
7.2.110.0150.00016.67
7.2.100.0090.00916.68
7.2.90.0040.00716.81
7.2.80.0070.00716.79
7.2.70.0030.01116.79
7.2.60.0150.00416.59
7.2.50.0100.00716.99
7.2.40.0120.00316.89
7.2.30.0030.01216.96
7.2.20.0040.01116.77
7.2.10.0040.00816.94
7.2.00.0070.01317.25
7.1.250.0030.00615.73
7.1.200.0120.00315.70
7.1.120.0090.00616.66
7.1.110.0260.00717.14
7.1.100.0190.00817.03
7.1.90.0200.00816.95
7.1.80.0320.00916.89
7.1.70.0190.00716.17
7.1.60.0290.00934.11
7.1.50.0300.00733.75
7.1.40.0340.00733.55
7.1.30.0280.01233.40
7.1.20.0270.01033.67
7.1.10.0060.01515.56
7.1.00.0180.01515.73
7.0.260.0370.00716.25
7.0.250.0180.00916.44
7.0.240.0280.01116.69
7.0.230.0300.00516.48
7.0.220.0100.00416.73
7.0.210.0150.01115.49
7.0.200.0410.00915.56
7.0.190.0240.00715.62
7.0.180.0170.00915.14
7.0.170.0170.01015.23
7.0.160.0170.00915.09
7.0.150.0130.00915.17
7.0.140.0190.01015.24
7.0.130.0190.00515.48
7.0.120.0160.00315.37
7.0.110.0110.01615.23
7.0.100.0620.01015.08
7.0.90.0090.01415.24
7.0.80.0140.01215.27
7.0.70.0120.00715.23
7.0.60.0080.01215.10
7.0.50.0120.01115.34
7.0.40.0190.00715.49
7.0.30.0090.01315.25
7.0.20.0140.00715.57
7.0.10.0110.00915.53
7.0.00.0130.00715.33
hhvm-3.22.00.0910.15392.52
hhvm-3.21.30.0710.17992.12
hhvm-3.21.00.0770.19190.90
hhvm-3.20.20.0670.19490.66
hhvm-3.19.20.0840.20290.65
hhvm-3.18.50.0640.17490.38
hhvm-3.18.40.0760.19689.25
hhvm-3.17.30.0700.20188.18
hhvm-3.15.40.0730.16886.11
hhvm-3.13.20.0710.18397.13
hhvm-3.12.140.0880.16095.82
hhvm-3.11.10.0800.19088.04
hhvm-3.10.10.0640.16784.71
5.6.300.0080.06620.74
5.6.290.0120.07820.67
5.6.280.0100.05721.03
5.6.270.0100.06220.87
5.6.260.0120.06720.84
5.6.250.0120.06820.89
5.6.240.0130.06820.84
5.6.230.0110.06420.76
5.6.220.0080.05820.76
5.6.210.0130.05520.94
5.6.200.0130.05820.78
5.6.190.0140.06420.82
5.6.180.0080.06620.84
5.6.170.0080.05720.97
5.6.160.0100.05920.77
5.6.150.0190.05320.89
5.6.140.0160.05020.73
5.6.130.0110.05820.87
5.6.120.0180.05020.74
5.6.110.0130.07520.81
5.6.100.0150.06620.79
5.6.90.0090.05420.72
5.6.80.0130.05220.19
5.6.70.0090.06120.25
5.6.60.0100.05420.22
5.6.50.0120.05120.22
5.6.40.0090.05420.25
5.6.30.0080.05820.27
5.6.20.0070.05820.20
5.6.10.0170.04520.15
5.6.00.0100.05220.20
5.5.380.0030.06217.44
5.5.370.0100.06917.41
5.5.360.0100.06917.43
5.5.350.0130.05217.41
5.5.340.0110.05417.95
5.5.330.0210.05117.98
5.5.320.0100.06017.96
5.5.310.0030.08117.98
5.5.300.0130.08218.06
5.5.290.0070.06118.07
5.5.280.0030.06217.96
5.5.270.0100.06717.97
5.5.260.0100.05617.80
5.5.250.0070.06717.87
5.5.240.0030.06417.35
5.5.230.0130.05017.38
5.5.220.0190.04117.09
5.5.210.0100.05217.20
5.5.200.0060.05417.24
5.5.190.0100.06117.27
5.5.180.0060.05517.24
5.5.160.0140.05117.34
5.5.150.0100.04817.09
5.5.140.0070.05317.35
5.5.130.0060.05517.31
5.5.120.0100.05917.31
5.5.110.0190.04417.23
5.5.100.0120.05017.18
5.5.90.0070.05517.04
5.5.80.0060.05817.23
5.5.70.0040.05717.22
5.5.60.0100.06717.25
5.5.50.0100.04917.32
5.5.40.0130.04717.18
5.5.30.0070.05317.12
5.5.20.0160.04517.31
5.5.10.0100.05916.93
5.5.00.0070.05317.19
5.4.450.0130.05819.45
5.4.440.0100.05719.13
5.4.430.0070.08019.25
5.4.420.0100.05119.50
5.4.410.0160.04819.24
5.4.400.0160.04218.98
5.4.390.0060.05518.90
5.4.380.0100.05018.93
5.4.370.0000.06419.00
5.4.360.0130.05118.95
5.4.350.0230.03618.79
5.4.340.0200.04218.80
5.4.320.0070.05319.09
5.4.310.0070.05118.89
5.4.300.0000.06318.86
5.4.290.0140.05819.01
5.4.280.0070.07618.95
5.4.270.0070.06518.98
5.4.260.0130.04518.86
5.4.250.0090.05118.98
5.4.240.0030.05919.01
5.4.230.0100.04918.98
5.4.220.0150.04619.02
5.4.210.0090.05018.80
5.4.200.0060.05219.07
5.4.190.0160.04218.76
5.4.180.0100.04919.02
5.4.170.0130.04719.16
5.4.160.0070.05219.03
5.4.150.0100.06118.97
5.4.140.0100.05516.50
5.4.130.0070.04716.48
5.4.120.0100.05016.48
5.4.110.0070.06816.61
5.4.100.0120.04616.64
5.4.90.0130.04216.56
5.4.80.0120.04216.35
5.4.70.0070.05016.34
5.4.60.0030.05116.50
5.4.50.0030.05216.60
5.4.40.0130.04216.60
5.4.30.0130.04616.49
5.4.20.0100.06516.38
5.4.10.0160.04516.60
5.4.00.0140.04215.71
5.3.290.0070.05414.84
5.3.280.0100.06214.59
5.3.270.0180.04214.60
5.3.260.0100.04914.60
5.3.250.0070.05014.70
5.3.240.0070.05114.76
5.3.230.0100.06014.76
5.3.220.0100.07014.62
5.3.210.0060.05514.55
5.3.200.0130.04614.53
5.3.190.0160.04214.62
5.3.180.0040.05314.55
5.3.170.0100.04614.55
5.3.160.0100.04614.56
5.3.150.0100.04814.56
5.3.140.0100.04614.73
5.3.130.0060.05314.54
5.3.120.0100.05014.75
5.3.110.0070.05314.49
5.3.100.0070.05214.21
5.3.90.0100.04714.18
5.3.80.0200.03713.96
5.3.70.0030.05114.01
5.3.60.0120.04313.81
5.3.50.0140.04513.79
5.3.40.0100.04614.04
5.3.30.0130.04014.00
5.3.20.0160.05813.89
5.3.10.0060.04813.85
5.3.00.0100.05513.74
5.2.170.0070.04211.27
5.2.160.0070.03911.20
5.2.150.0100.03611.38
5.2.140.0100.03810.97
5.2.130.0120.04211.23
5.2.120.0130.03111.22
5.2.110.0000.04911.32
5.2.100.0060.04311.23
5.2.90.0060.04911.22
5.2.80.0060.05811.21
5.2.70.0150.05011.23
5.2.60.0120.05310.86
5.2.50.0070.05510.95
5.2.40.0070.04911.21
5.2.30.0190.04811.16
5.2.20.0140.04811.10
5.2.10.0150.05010.73
5.2.00.0220.05410.83
5.1.60.0150.0409.97
5.1.50.0010.04910.08
5.1.40.0060.0409.85
5.1.30.0100.03810.46
5.1.20.0060.03810.51
5.1.10.0120.03310.36
5.1.00.0110.04510.37
5.0.50.0080.0309.23
5.0.40.0100.0349.23
5.0.30.0090.0389.23
5.0.20.0050.0289.23
5.0.10.0090.0269.23
5.0.00.0040.0579.23
4.4.90.0060.0279.23
4.4.80.0150.0209.23
4.4.70.0030.0309.23
4.4.60.0100.0249.23
4.4.50.0150.0209.23
4.4.40.0060.0449.23
4.4.30.0040.0269.23
4.4.20.0060.0199.23
4.4.10.0030.0269.23
4.4.00.0110.0419.23
4.3.110.0040.0319.23
4.3.100.0040.0269.23
4.3.90.0070.0279.23
4.3.80.0120.0309.23
4.3.70.0030.0309.23
4.3.60.0030.0229.23
4.3.50.0100.0159.23
4.3.40.0030.0339.23
4.3.30.0030.0279.23
4.3.20.0060.0229.23
4.3.10.0060.0199.23
4.3.00.0090.0169.23