3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <!DOCTYPE root [ <!ENTITY attack SYSTEM "config/config.ini"> <!ENTITY ent SYSTEM "entities/ent.txt"> ]> <xml> &attack; &ent; </xml> XML; // emulate existing local file mkdir('/tmp/entities/'); file_put_contents('/tmp/entities/ent.txt', 'OK ENTITY'); libxml_set_external_entity_loader( function (?string $public, ?string $system, array $context) { $path = realpath('/tmp' . $system); if ($public === null && $path !== null && str_starts_with($path, '/tmp/entities/')) { $resolved = file_get_contents('/tmp' . $system); } else { $resolved = 'nice try but no'; } $f = fopen('php://temp', 'r+'); fwrite($f, $resolved); rewind($f); return $f; } ); $doc = new DOMDocument; $doc->loadXML($xml, LIBXML_NOENT); echo $doc->saveXML(); ?>

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.3.140.0150.00417.00
8.3.130.0040.00418.70
8.3.120.0060.01319.05
8.3.110.0060.00320.94
8.3.100.0000.01124.06
8.3.90.0000.00926.77
8.3.80.0170.00424.40
8.3.70.0150.00924.70
8.3.60.0340.00727.56
8.3.50.0150.00627.56
8.3.40.0360.00827.56
8.3.30.0380.00727.56
8.3.20.0280.00927.56
8.3.10.0350.00527.56
8.3.00.0270.00727.56
8.2.260.0030.00619.24
8.2.250.0040.00417.21
8.2.240.0090.00617.35
8.2.230.0030.01322.58
8.2.220.0040.00437.54
8.2.210.0080.00026.77
8.2.200.0100.00623.86
8.2.190.0150.00623.86
8.2.180.0310.00927.56
8.2.170.0400.00727.56
8.2.160.0280.00527.56
8.2.150.0260.00627.56
8.2.140.0300.00327.56
8.2.130.0310.00527.56
8.2.120.0310.00627.56
8.2.110.0350.00627.56
8.2.100.0330.00627.56
8.2.90.0280.00927.56
8.2.80.0330.00627.56
8.2.70.0320.00827.56
8.2.60.0250.01027.56
8.2.50.0310.00927.56
8.2.40.0260.01127.56
8.2.30.0320.00727.56
8.2.20.0350.00627.56
8.2.10.0300.00827.56
8.2.00.0250.00927.56
8.1.300.0150.00416.77
8.1.290.0140.00430.84
8.1.280.0280.00927.56
8.1.270.0340.00527.56
8.1.260.0300.01027.56
8.1.250.0370.00727.56
8.1.240.0240.00827.56
8.1.230.0220.00927.56
8.1.220.0190.01027.56
8.1.210.0280.00327.56
8.1.200.0290.00527.56
8.1.190.0360.00627.56
8.1.180.0310.00227.56
8.1.170.0280.00627.56
8.1.160.0310.00427.56
8.1.150.0290.00527.56
8.1.140.0270.00827.56
8.1.130.0280.00627.56
8.1.120.0220.00627.56
8.1.110.0200.01027.56
8.1.100.0270.00527.56
8.1.90.0260.00627.56
8.1.80.0260.00827.56
8.1.70.0290.00627.56
8.1.60.0250.01227.56
8.1.50.0300.00827.56
8.1.40.0310.00627.56
8.1.30.0380.00227.56
8.1.20.0290.00927.56
8.1.10.0280.00627.56
8.1.00.0290.00827.56
7.4.330.0180.01230.84

preferences:
32.53 ms | 403 KiB | 5 Q