3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * class.MarsLogger.php * * CreatedBy: dbuchanan@cotterweb.net * CreatedOn: 4/3/15 * * Requires: _variables.php (BatchProcessLogging) * * This class created for MarketResearch, to simplify logging to BatchProcess and Email Alerts * */ ///Required for doing batchProcessLogging require_once '_variables.php'; /* ------------------------------------------------------------- */ /* * This class handles logging, emailing alerts, tracking debug, env, site, name stuff */ /* ------------------------------------------------------------- */ class MarketResearch_logger { protected $env; protected $debug=0; protected $site; protected $name; protected $admin_email='techadmin@cotterweb.net'; protected $dev_email='dbuchanan@cotterweb.net'; protected $batchProcessLogging; protected $finish_comment = array(); public function getSite() { return $this->site; } public function getEnv() { return $this->env; } /* public function getDebug() { return $this->debug; } */ public function getAdminEmail() { if($this->getEnv()=='dev') return $this->dev_email; else return $this->admin_email; } public function alreadyRunning() { /* See if cron is already running */ $exec_results = array(); exec("ps -ef | grep \"{$this->name}*{$this->getSite()}\" | grep -v grep | wc -l", $exec_results); return $exec_results; } protected function initLog($name) { $this->name=$name; $this->batchProcessLogging = new BatchProcessLogging($name, 'CRON'); } protected function setDebug($debug) { $this->debug=$debug; } public function startLog() { if($this->debug==0) $this->batchProcessLogging->logBatchStart(); else if($this->debug==1) { $this->batchProcessLogging->logBatchStart(); echo "\nStart Market Research Import"; } else { echo "\nStart Market Research Import"; } } public function logComment($message) { if($this->debug==0) $this->batchProcessLogging->logBatchComment($message); else if($this->debug==1) { $this->batchProcessLogging->logBatchComment($message); echo "\n$message"; } else { echo "\n$message"; } } public function addFinishComment($message) { array_push($this->finish_comment,$message); } public function sendEmailFinish($message) { $recipients = $this->getAdminEmail(); $subject = $this->site. ' Success: '.$this->name; $from = 'From: ' . $this->site . ' Cron Results'; $email_body = $this->site . ' '. $message; mail($recipients, $subject, $email_body, $from); } public function sendEmailAlert($message) { $recipients = $this->getAdminEmail(); $subject = $this->site. ' Problem Alert: '.$this->name; $from = 'From: ' . $this->site . ' Cron Results'; $email_body = $this->site . ' '. $message; mail($recipients, $subject, $email_body, $from); } public function endLog($message) { if($this->debug==0) { $this->batchProcessLogging->logBatchFinish($message . $this->batchProcessLogging->getElapsedBatchExecutionTime(true), 0, 0); } else if($this->debug==1) { foreach($this->finish_comment as $m) { $this->logComment($m); } $this->batchProcessLogging->logBatchFinish($message . $this->batchProcessLogging->getElapsedBatchExecutionTime(true), 0, 0); var_dump($this->finish_comment); echo "\n$message END LOG"; } else { var_dump($this->finish_comment); echo "\n$message"; } } }

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.60.0090.00616.75
8.3.50.0130.00822.05
8.3.40.0070.00718.90
8.3.30.0110.00419.21
8.3.20.0040.00420.34
8.3.10.0040.00421.64
8.3.00.0000.00819.21
8.2.180.0090.00618.54
8.2.170.0060.00918.96
8.2.160.0030.01022.96
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00819.54
8.2.110.0070.00322.18
8.2.100.0070.00417.84
8.2.90.0080.00019.23
8.2.80.0000.00817.97
8.2.70.0050.00317.63
8.2.60.0070.00317.80
8.2.50.0060.00318.07
8.2.40.0040.00418.27
8.2.30.0000.00819.46
8.2.20.0030.00517.76
8.2.10.0040.00418.09
8.2.00.0070.00017.84
8.1.280.0130.01025.92
8.1.270.0070.00318.98
8.1.260.0030.00626.35
8.1.250.0030.00728.09
8.1.240.0040.00423.96
8.1.230.0070.00419.09
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0040.00417.35
8.1.190.0090.00017.48
8.1.180.0050.00318.10
8.1.170.0090.00018.65
8.1.160.0000.00722.13
8.1.150.0000.00718.80
8.1.140.0030.00517.36
8.1.130.0030.00317.79
8.1.120.0040.00417.49
8.1.110.0040.00417.40
8.1.100.0040.00417.43
8.1.90.0000.00817.53
8.1.80.0040.00417.45
8.1.70.0000.00717.40
8.1.60.0040.00417.67
8.1.50.0120.00017.54
8.1.40.0040.00417.60
8.1.30.0030.00517.58
8.1.20.0030.00517.65
8.1.10.0030.00617.58
8.1.00.0030.00617.60
8.0.300.0070.00018.77
8.0.290.0030.00617.00
8.0.280.0000.00718.57
8.0.270.0050.00217.28
8.0.260.0000.00617.33
8.0.250.0040.00417.16
8.0.240.0000.00717.17
8.0.230.0040.00417.07
8.0.220.0070.00016.92
8.0.210.0000.00816.98
8.0.200.0000.00617.16
8.0.190.0060.00317.04
8.0.180.0040.00417.12
8.0.170.0000.00817.07
8.0.160.0040.00416.99
8.0.150.0000.00716.95
8.0.140.0040.00417.02
8.0.130.0000.00613.45
8.0.120.0050.00317.00
8.0.110.0000.00817.00
8.0.100.0040.00417.14
8.0.90.0040.00417.14
8.0.80.0090.00617.09
8.0.70.0070.00016.88
8.0.60.0000.00717.14
8.0.50.0080.00017.02
8.0.30.0080.01317.25
8.0.20.0080.01217.40
8.0.10.0040.00417.12
8.0.00.0100.01016.88
7.4.330.0000.00515.18
7.4.320.0060.00016.55
7.4.300.0060.00016.57
7.4.290.0000.00716.59
7.4.280.0080.00016.66
7.4.270.0080.00016.64
7.4.260.0080.00016.69
7.4.250.0070.00016.55
7.4.240.0030.00416.57
7.4.230.0040.00416.77
7.4.220.0120.00616.67
7.4.210.0060.00916.58
7.4.200.0030.00316.76
7.4.160.0100.01016.72
7.4.150.0040.01517.40
7.4.140.0140.01017.86
7.4.130.0070.01016.63
7.4.120.0080.01016.46
7.4.110.0040.01416.50
7.4.100.0150.00716.79
7.4.90.0070.01116.45
7.4.80.0130.00619.39
7.4.70.0120.01216.37
7.4.60.0130.00316.49
7.4.50.0050.00016.48
7.4.40.0100.00716.57
7.4.30.0100.00716.50
7.4.10.0030.01714.61
7.4.00.0100.00715.07
7.3.330.0030.00313.17
7.3.320.0030.00313.31
7.3.310.0000.00716.36
7.3.300.0000.00716.41
7.3.290.0030.00316.33
7.3.280.0080.00916.32
7.3.270.0090.00917.40
7.3.260.0120.01216.39
7.3.250.0110.01116.32
7.3.240.0040.01516.34
7.3.230.0080.00816.51
7.3.210.0080.00816.53
7.3.200.0170.00719.39
7.3.190.0090.01216.35
7.3.180.0100.00716.45
7.3.170.0000.01916.34
7.3.160.0110.00616.53
7.3.130.0060.01214.66
7.3.120.0090.00714.86
7.3.110.0040.01414.97
7.3.100.0060.00814.71
7.3.90.0070.00714.84
7.3.80.0090.00414.88
7.3.70.0050.00714.75
7.3.60.0030.01014.70
7.3.50.0070.00714.67
7.3.40.0050.00414.65
7.3.30.0060.00614.79
7.3.20.0060.00316.63
7.3.10.0040.01116.58
7.3.00.0030.00916.57
7.2.330.0190.00616.66
7.2.320.0110.00516.55
7.2.310.0120.00616.69
7.2.300.0100.00716.66
7.2.290.0100.01316.70
7.2.260.0130.00714.64
7.2.250.0080.01014.82
7.2.240.0070.01015.01
7.2.230.0080.00814.96
7.2.220.0050.00914.86
7.2.210.0080.00714.91
7.2.200.0050.00814.82
7.2.190.0060.00414.88
7.2.180.0040.01114.89
7.2.170.0050.01014.95
7.2.160.0000.00914.73
7.2.150.0100.00616.60
7.2.140.0060.00916.91
7.2.130.0080.00416.81
7.2.120.0040.00916.86
7.2.110.0050.01116.71
7.2.100.0040.01116.48
7.2.90.0060.00916.74
7.2.80.0050.00816.75
7.2.70.0050.01016.58
7.2.60.0050.00816.85
7.2.50.0080.00716.62
7.2.40.0050.01016.91
7.2.30.0070.00816.74
7.2.20.0020.01216.59
7.2.10.0070.00716.85
7.2.00.0060.00617.51
7.1.330.0100.00415.58
7.1.320.0020.01315.58
7.1.310.0060.00715.58
7.1.300.0070.00715.64
7.1.290.0020.00815.49
7.1.280.0080.00515.68
7.1.270.0060.00715.59
7.1.260.0050.00915.57
7.1.250.0030.01315.78
7.1.240.0070.00715.58
7.1.230.0040.00815.64
7.1.220.0080.00615.40
7.1.210.0090.00515.44
7.1.200.0030.01115.81
7.1.190.0040.00715.59
7.1.180.0040.00715.68
7.1.170.0030.00715.71
7.1.160.0050.00715.71
7.1.150.0040.01015.63
7.1.140.0040.00915.68
7.1.130.0040.00815.61
7.1.120.0080.00715.79
7.1.110.0070.00615.54
7.1.100.0030.01016.53
7.1.90.0070.00615.51
7.1.80.0070.00815.71
7.1.70.0050.00716.05
7.1.60.0080.00816.92
7.1.50.0060.01116.01
7.1.40.0030.01015.55
7.1.30.0060.00615.47
7.1.20.0120.00215.60
7.1.10.0040.01015.55
7.1.00.0060.03417.77
7.0.330.0020.01015.36
7.0.320.0000.01115.28
7.0.310.0060.00514.96
7.0.300.0020.00715.12
7.0.290.0040.00515.03
7.0.280.0050.00715.19
7.0.270.0020.01215.13
7.0.260.0080.00515.21
7.0.250.0030.01115.32
7.0.240.0020.00815.24
7.0.230.0020.01215.11
7.0.220.0030.00814.95
7.0.210.0030.01115.09
7.0.200.0010.01015.69
7.0.190.0020.01115.33
7.0.180.0100.00315.29
7.0.170.0040.00915.15
7.0.160.0030.01015.35
7.0.150.0000.01415.08
7.0.140.0060.02517.50
7.0.130.0020.01015.27
7.0.120.0030.00915.35
7.0.110.0050.00515.29
7.0.100.0060.00815.19
7.0.90.0080.00215.07
7.0.80.0080.00615.15
7.0.70.0090.00615.29
7.0.60.0060.03016.81
7.0.50.0040.03416.01
7.0.40.0060.03015.63
7.0.30.0140.02715.65
7.0.20.0110.02615.55
7.0.10.0080.01915.59
7.0.00.0080.02815.57
5.6.400.0030.00914.06
5.6.390.0060.00614.09
5.6.380.0090.00314.26
5.6.370.0080.00814.00
5.6.360.0050.00514.12
5.6.350.0030.00914.37
5.6.340.0040.00914.17
5.6.330.0060.00914.14
5.6.320.0040.01214.35
5.6.310.0070.00314.10
5.6.300.0060.01014.09
5.6.290.0050.00713.93
5.6.280.0080.02516.31
5.6.270.0110.00314.15
5.6.260.0060.00614.11
5.6.250.0060.00414.02
5.6.240.0080.00514.10
5.6.230.0060.00614.12
5.6.220.0030.01014.16
5.6.210.0110.02516.29
5.6.200.0100.03015.45
5.6.190.0100.02316.41
5.6.180.1090.01816.29
5.6.170.0120.02416.27
5.6.160.0070.03016.40
5.6.150.0050.03215.61
5.6.140.0060.03215.57
5.6.130.0070.01715.47
5.6.120.0070.02016.38
5.6.110.0070.03216.48
5.6.100.0040.03016.42
5.6.90.0060.02816.49
5.6.80.0060.03116.13
5.6.70.1050.01716.21
5.6.60.0020.01113.96
5.6.50.0070.00313.93
5.6.40.0120.00114.04
5.6.30.0070.00613.99
5.6.20.0050.01013.98
5.6.10.0030.00913.95
5.6.00.0000.01414.14
5.5.380.0050.01012.52
5.5.370.0030.00912.66
5.5.360.0070.00712.34
5.5.350.0160.02615.17
5.5.340.0080.02214.36
5.5.330.0060.03115.04
5.5.320.0090.03015.20
5.5.310.0140.02915.11
5.5.300.0030.02114.25
5.5.290.0070.01714.20
5.5.280.0090.03115.15
5.5.270.0070.02915.27
5.5.260.0060.02315.33
5.5.250.0030.03515.19
5.5.240.0120.02915.04
5.5.230.0050.00512.49
5.5.220.0050.00512.56
5.5.210.0060.00612.30
5.5.200.0010.01112.22
5.5.190.0060.00512.34
5.5.180.0050.00812.52
5.5.170.0070.00612.39
5.5.160.0030.00612.50
5.5.150.0030.00612.59
5.5.140.0050.00612.35
5.5.130.0030.00512.48
5.5.120.0070.00512.48
5.5.110.0050.00612.52
5.5.100.0050.00712.39
5.5.90.0060.00412.34
5.5.80.0050.00912.34
5.5.70.0060.00512.46
5.5.60.0060.00212.44
5.5.50.0100.00112.41
5.5.40.0020.00912.38
5.5.30.0080.00512.30
5.5.20.0070.00512.41
5.5.10.0060.00612.29
5.5.00.0060.00512.43
5.4.450.0180.02313.75
5.4.440.0120.02813.75
5.4.430.0080.02213.87
5.4.420.0070.02313.78
5.4.410.0070.02613.68
5.4.400.0080.02113.55
5.4.390.0310.02313.47
5.4.380.0410.01913.59
5.4.370.0410.02513.48
5.4.360.0400.02513.37
5.4.350.0360.02113.37
5.4.340.0290.02713.59
5.4.330.0010.01110.73
5.4.320.0280.02513.50
5.4.310.0340.02013.36
5.4.300.0310.02513.48
5.4.290.0320.02013.43
5.4.280.0460.01513.49
5.4.270.0320.02513.42
5.4.260.0330.02113.49
5.4.250.0490.02013.38
5.4.240.0390.02413.41
5.4.230.0300.03013.40
5.4.220.0340.02513.46
5.4.210.0360.02313.44
5.4.200.0330.02212.75
5.4.190.0410.01613.57
5.4.180.0320.02213.59
5.4.170.0430.01813.31
5.4.160.0380.02613.44
5.4.150.0320.02413.41
5.4.140.0460.02112.75
5.4.130.0410.02912.63
5.4.120.0290.02212.65
5.4.110.0330.02012.74
5.4.100.0440.02812.58
5.4.90.0410.02112.65
5.4.80.0280.02212.63
5.4.70.0290.02512.72
5.4.60.0380.01812.70
5.4.50.0320.02812.72
5.4.40.0330.02212.56
5.4.30.0400.02112.72
5.4.20.0330.02412.71
5.4.10.0310.02512.72
5.4.00.0310.02012.53
5.3.290.0500.03012.86
5.3.280.0510.03012.78
5.3.270.0530.03212.86
5.3.260.0500.03912.88
5.3.250.0640.02712.81
5.3.240.0650.02512.88
5.3.230.0580.02812.79
5.3.220.0530.03112.76
5.3.210.0530.03512.80
5.3.200.0530.03112.78
5.3.190.0580.03412.74
5.3.180.0500.03212.80
5.3.170.0380.03312.77
5.3.160.0550.03012.77
5.3.150.0610.03612.77
5.3.140.0460.03312.76
5.3.130.0530.02612.75
5.3.120.0550.03912.82
5.3.110.0400.03612.75
5.3.100.0460.03012.48
5.3.90.0520.03512.48
5.3.80.0600.03012.49
5.3.70.0520.03712.47
5.3.60.0480.02512.55
5.3.50.0520.03212.55
5.3.40.0420.03312.52
5.3.30.0470.02912.43
5.3.20.0400.02912.31
5.3.10.0400.02712.36
5.3.00.0400.03212.30
5.2.170.0380.02711.15
5.2.160.0470.02711.09
5.2.150.0320.02811.07
5.2.140.0400.02011.09
5.2.130.0330.02511.04
5.2.120.0390.02211.12
5.2.110.0350.02511.03
5.2.100.0350.02511.06
5.2.90.0320.03611.07
5.2.80.0370.02811.13
5.2.70.0390.02411.04
5.2.60.0320.02811.04
5.2.50.0350.02611.00
5.2.40.0230.02811.02
5.2.30.0470.02510.97
5.2.20.0360.02110.98
5.2.10.0330.02611.01
5.2.00.0370.02310.90
5.1.60.0280.02010.46
5.1.50.0300.01810.49
5.1.40.0230.02210.55
5.1.30.0330.02710.68
5.1.20.0300.02610.75
5.1.10.0320.02010.51
5.1.00.0380.01710.53
5.0.50.0180.0189.82
5.0.40.0210.0139.72
5.0.30.0200.0259.64
5.0.20.0210.0209.62
5.0.10.0250.0169.62
5.0.00.0210.0349.60
4.4.90.0190.0128.73
4.4.80.0180.0158.73
4.4.70.0150.0168.73
4.4.60.0160.0138.73
4.4.50.0180.0148.73
4.4.40.0180.0218.73
4.4.30.0180.0158.73
4.4.20.0220.0128.73
4.4.10.0170.0128.73
4.4.00.0150.0188.73
4.3.110.0120.0158.73
4.3.100.0150.0118.73
4.3.90.0130.0138.73
4.3.80.0150.0198.73
4.3.70.0180.0088.73
4.3.60.0150.0118.73
4.3.50.0150.0138.73
4.3.40.0130.0208.73
4.3.30.0050.0168.73
4.3.20.0080.0138.73
4.3.10.0080.0138.73
4.3.00.0060.01310.06

preferences:
57.2 ms | 401 KiB | 5 Q