3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* This is an untested re-scripting of Luis' posted snippet. * I am mostly avoiding single-use variables and separating "processing" from "displaying" portions of code * I am have added spaces when concatenating with dots, and between function parameters. * The addition of the head tags is only done if the option and view parameters are satisfactory. * Finally, it may be a good idea to call addcslashes($string, '"') on your variables for stability */ if (JRequest::getCmd('option') === "com_content" && JRequest::getCmd('view') === "article") { $doc =& JFactory::getDocument(); $article =& JTable::getInstance("content"); $article->load(strstr(JRequest::getString('id'), ':', true)); $twitterTitle = mb_strimwidth(strip_tags($article->get("title")), 0, 225, " ..."); $twitterDescription = mb_strimwidth(strip_tags($doc->getMetaData('description')), 0, 225, " ..."); $introImage = 'http://yourdomain.com/' . json_decode($article->get("images"))->image_intro; $doc->addCustomTag(' <meta name="twitter:title" content="{$twitterTitle}"/> <meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:site" content="yoursite"/> <meta name="twitter:creator" content="yourcreator"/> <meta name="twitter:url" content="' . JURI::current() . '"/> <meta name="twitter:description" content="{$twitterDescription}"/> <meta name="twitter:image" content="{$introImage}"/> '); }

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.5.10.0110.00816.81
8.5.00.0140.00720.06
8.4.150.0030.00014.05
8.4.140.0120.01117.68
8.4.130.0140.00617.80
8.4.120.0040.00420.56
8.4.110.0070.00322.71
8.4.100.0130.01017.97
8.4.90.0060.00418.66
8.4.80.0030.00717.82
8.4.70.0060.00318.02
8.4.60.0110.00918.78
8.4.50.0130.00719.52
8.4.40.0040.00419.51
8.4.30.0030.00718.81
8.4.20.0070.01318.81
8.4.10.0030.00617.84
8.3.280.0100.01018.21
8.3.270.0140.00616.49
8.3.260.0120.00816.67
8.3.250.0030.00519.02
8.3.240.0140.00517.27
8.3.230.0140.00516.60
8.3.220.0120.00517.25
8.3.210.0130.00716.77
8.3.200.0140.00516.56
8.3.190.0120.00617.21
8.3.180.0120.00816.77
8.3.170.0140.00420.53
8.3.160.0120.00618.47
8.3.150.0150.00317.25
8.3.140.0150.00316.54
8.3.130.0050.00318.43
8.3.120.0060.00320.71
8.3.110.0120.00420.94
8.3.100.0030.00618.19
8.3.90.0140.00026.77
8.3.80.0060.00317.97
8.3.70.0170.00318.31
8.3.60.0120.00618.31
8.3.50.0120.00818.98
8.3.40.0140.00419.02
8.3.30.0070.01018.70
8.3.20.0030.00520.95
8.3.10.0090.00022.08
8.3.00.0130.00720.73
8.2.290.0170.00520.17
8.2.280.0060.00418.65
8.2.270.0090.00917.24
8.2.260.0130.00718.48
8.2.250.0050.00316.99
8.2.240.0030.00718.64
8.2.230.0030.00922.58
8.2.220.0100.00724.06
8.2.210.0000.00826.77
8.2.200.0060.00618.41
8.2.190.0070.00716.58
8.2.180.0000.01518.66
8.2.170.0100.01022.96
8.2.160.0070.00722.13
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00020.78
8.2.110.0090.00020.35
8.2.100.0060.00617.78
8.2.90.0090.00017.82
8.2.80.0000.00919.07
8.2.70.0040.00417.63
8.2.60.0000.00817.50
8.2.50.0000.00817.63
8.2.40.0040.00418.09
8.2.30.0000.00717.93
8.2.20.0040.00418.05
8.2.10.0070.00319.52
8.2.00.0000.00719.23
8.1.330.0100.00621.80
8.1.320.0080.01019.99
8.1.310.0140.00418.62
8.1.300.0090.00016.46
8.1.290.0130.00030.84
8.1.280.0070.01325.92
8.1.270.0160.00323.76
8.1.260.0030.00526.35
8.1.250.0000.00828.09
8.1.240.0030.00723.90
8.1.230.0080.00323.89
8.1.220.0040.00417.74
8.1.210.0090.00018.77
8.1.200.0040.00417.10
8.1.190.0060.00317.41
8.1.180.0000.01018.10
8.1.170.0030.00518.57
8.1.160.0040.00418.75
8.1.150.0040.00418.57
8.1.140.0000.00720.32
8.1.130.0070.00017.38
8.1.120.0000.00717.38
8.1.110.0080.00017.36
8.1.100.0000.00917.40
8.1.90.0000.00717.43
8.1.80.0000.00817.38
8.1.70.0030.00317.40
8.1.60.0040.00417.45
8.1.50.0040.00417.56
8.1.40.0000.00917.55
8.1.30.0040.00417.66
8.1.20.0000.00917.64
8.1.10.0060.00317.46
8.1.00.0050.00517.41
8.0.300.0060.00320.02
8.0.290.0040.00416.63
8.0.280.0000.00718.34
8.0.270.0040.00417.25
8.0.260.0000.00716.84
8.0.250.0000.00817.00
8.0.240.0030.00316.96
8.0.230.0040.00416.90
8.0.220.0000.00816.91
8.0.210.0000.00716.95
8.0.200.0040.00416.87
8.0.190.0070.00016.89
8.0.180.0060.00316.94
8.0.170.0090.00016.84
8.0.160.0000.00816.88
8.0.150.0040.00416.78
8.0.140.0070.00416.81
8.0.130.0000.00513.36
8.0.120.0000.00916.93
8.0.110.0000.00716.95
8.0.100.0040.00416.81
8.0.90.0030.00416.95
8.0.80.0070.01016.89
8.0.70.0040.00416.90
8.0.60.0030.00516.98
8.0.50.0050.00216.80
8.0.30.0170.00217.13
8.0.20.0090.00816.82
8.0.10.0080.00016.89
8.0.00.0090.00916.93
7.4.330.0000.00515.55
7.4.320.0000.00616.52
7.4.300.0060.00016.40
7.4.290.0030.00316.48
7.4.280.0090.00016.39
7.4.270.0070.00016.60
7.4.260.0050.00013.19
7.4.250.0030.00316.44
7.4.240.0040.00416.58
7.4.230.0070.00016.70
7.4.220.0020.00516.59
7.4.210.0090.00716.58
7.4.200.0080.00016.24
7.4.130.0060.01616.39
7.4.120.0140.00716.39
7.4.110.0100.00716.51
7.4.100.0070.01016.59
7.4.90.0060.01016.40
7.4.80.0140.01119.39
7.4.70.0100.01116.64
7.4.60.0060.00916.39
7.4.50.0100.00616.45
7.4.40.0070.01116.56
7.4.10.0130.00715.14
7.4.00.0090.00814.97
7.3.330.0030.00716.14
7.3.320.0030.00313.22
7.3.310.0030.00316.23
7.3.300.0030.00316.34
7.3.290.0130.00416.30
7.3.280.0000.01516.30
7.3.260.0090.00816.46
7.3.240.0070.01116.37
7.3.230.0090.00916.32
7.3.210.0110.00616.34
7.3.200.0100.00716.41
7.3.190.0110.00616.55
7.3.180.0120.00916.26
7.3.170.0080.00816.28
7.3.160.0070.00916.50
7.3.130.0060.01214.54
7.3.120.0080.00814.99
7.3.110.0100.00814.83
7.3.100.0090.00814.68
7.3.90.0030.01314.81
7.3.80.0110.01014.65
7.3.70.0050.01014.84
7.3.60.0090.00714.80
7.3.50.0050.00614.50
7.3.40.0040.01014.74
7.3.30.0070.01014.64
7.3.20.0040.01115.96
7.3.10.0090.00515.85
7.3.00.0100.00415.96
7.2.330.0100.01316.71
7.2.320.0060.01216.59
7.2.310.0080.00816.20
7.2.300.0060.01116.36
7.2.290.0100.00716.56
7.2.260.0070.01114.98
7.2.250.0070.01314.84
7.2.240.0020.01414.85
7.2.230.0040.01114.88
7.2.220.0060.01014.85
7.2.210.0040.00914.86
7.2.200.0060.00914.89
7.2.190.0060.00814.75
7.2.180.0050.00714.80
7.2.170.0100.00414.86
7.2.160.0070.01014.99
7.2.150.0190.01015.70
7.2.140.0060.01115.64
7.2.130.0150.00515.88
7.2.120.0120.00415.87
7.2.110.0110.00615.90
7.2.100.0110.00315.82
7.2.90.0080.00615.76
7.2.80.0110.00415.79
7.2.70.0030.01315.79
7.2.60.0080.01015.63
7.2.50.0050.01315.81
7.2.40.0070.01215.75
7.2.30.0040.01115.84
7.2.20.0060.00915.81
7.2.10.0070.00915.74
7.2.00.0080.00815.92
7.1.330.0050.00815.62
7.1.320.0050.00814.98
7.1.310.0070.00814.80
7.1.300.0120.00914.88
7.1.290.0090.00414.96
7.1.280.0090.00714.97
7.1.270.0040.01314.89
7.1.260.0030.00914.93
7.1.250.0060.01214.59
7.1.240.0040.01115.68
7.1.230.0000.01815.71
7.1.220.0070.00715.65
7.1.210.0030.00915.34
7.1.200.0060.00915.68
7.1.190.0070.00715.77
7.1.180.0100.00315.47
7.1.170.0080.00015.50
7.1.160.0070.01015.63
7.1.150.0030.00615.79
7.1.140.0060.00315.64
7.1.130.0040.01115.63
7.1.120.0100.00315.48
7.1.110.0040.01115.41
7.1.100.0040.00715.59
7.1.90.0100.00315.63
7.1.80.0000.01415.77
7.1.70.0070.00615.56
7.1.60.0000.00915.72
7.1.50.0060.00615.64
7.1.40.0040.00815.49
7.1.30.0060.00315.55
7.1.20.0060.00915.62
7.1.10.0060.00615.52
7.1.00.0140.00015.73

preferences:
185.21 ms | 403 KiB | 5 Q