3v4l.org

run code in 300+ PHP versions simultaneously
<?php function do_upload() { $upload_conf = array( 'upload_path' => realpath('assets/doc/img/real/'), 'allowed_types' => 'gif|jpg|png|JPEG|JPG', 'max_size' => '30000', 'encrypt_name' => TRUE, // NOT WORK! ANY IDEA? 'remove_spaces' => TRUE, 'overwrite' => TRUE ); $this->load->library('upload', $upload_conf); foreach ($_FILES['userfile'] as $key => $val) { $i = 1; foreach ($val as $v) { $field_name = "file_" . $i; $_FILES[$field_name][$key] = $v; $i++; } } unset($_FILES['userfile']); foreach ($_FILES as $field_name => $file) { if (!$this->upload->do_upload($field_name)) { echo $this->image_lib->display_errors(); } else { $upload_data = $this->upload->data(); // ITS WORKING // Watermark $ori = $upload_data['file_name']; $mr = $upload_data['file_path'] . $ori; $this->watermarking($mr); /* // ITS WORKING //this is the larger image $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/full/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 0; $config['height'] = 0; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); //this is the larger image $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/medium/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 342; $config['height'] = 342; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); //small image $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/small/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 152; $config['height'] = 152; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); //cropped thumbnail $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/thumbnails/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 62; $config['height'] = 62; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); */ // do it! if (!$this->image_lib->resize()) { // if got fail. //$error['resize'][] = $this->image_lib->display_errors(); echo $this->image_lib->display_errors(); } else { // otherwise, put each upload data to an array. $success[] = $upload_data; } } } // see what we get if (count($error > 0)) { $data['error'] = $error; } else { $data['success'] = $upload_data; } $data['multiupload'] = "multiupload"; // Controller $data['view'] = "index_multiupload"; // View $data['module'] = "multiupload"; // Controller $data['error'] = ' '; dump($this->upload->data()); echo Modules::run('template/staff', $data); }

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.0040.01116.63
8.3.50.0150.00517.37
8.3.40.0100.00718.72
8.3.30.0140.00018.57
8.3.20.0060.00318.69
8.3.10.0080.00018.52
8.3.00.0030.00617.38
8.2.180.0220.00016.75
8.2.170.0080.00822.96
8.2.160.0040.01218.59
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00421.00
8.2.110.0070.00321.12
8.2.100.0090.00317.72
8.2.90.0050.00317.66
8.2.80.0000.01019.77
8.2.70.0080.00017.38
8.2.60.0030.00517.50
8.2.50.0030.00517.38
8.2.40.0090.00017.62
8.2.30.0000.01017.52
8.2.20.0000.01017.59
8.2.10.0000.00817.57
8.2.00.0040.00417.64
8.1.280.0040.01125.92
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00021.12
8.1.230.0080.00420.90
8.1.220.0040.00417.74
8.1.210.0080.00018.85
8.1.200.0000.00817.23
8.1.190.0040.00717.10
8.1.180.0060.00318.10
8.1.170.0030.00517.62
8.1.160.0060.00318.54
8.1.150.0040.00418.58
8.1.140.0000.00817.35
8.1.130.0040.00417.26
8.1.120.0000.00917.35
8.1.110.0000.00817.39
8.1.100.0040.00417.24
8.1.90.0000.00717.36
8.1.80.0000.00717.25
8.1.70.0000.00717.38
8.1.60.0040.00417.31
8.1.50.0040.00417.36
8.1.40.0040.00417.39
8.1.30.0070.00317.44
8.1.20.0060.00317.54
8.1.10.0000.00917.45
8.1.00.0040.00417.33
8.0.300.0080.00019.77
8.0.290.0080.00016.58
8.0.280.0080.00017.92
8.0.270.0000.00717.08
8.0.260.0030.00316.72
8.0.250.0000.00716.88
8.0.240.0040.00416.84
8.0.230.0000.00716.86
8.0.220.0000.00716.79
8.0.210.0000.00716.80
8.0.200.0000.00716.82
8.0.190.0040.00416.73
8.0.180.0000.00716.73
8.0.170.0030.00616.87
8.0.160.0020.00516.71
8.0.150.0040.00416.74
8.0.140.0050.00316.74
8.0.130.0030.00313.23
8.0.120.0060.00316.68
8.0.110.0000.00716.61
8.0.100.0000.00716.66
8.0.90.0000.00716.83
8.0.80.0120.01216.74
8.0.70.0030.00516.80
8.0.60.0030.00616.61
8.0.50.0050.00316.81
8.0.30.0120.00617.09
8.0.20.0130.01016.95
8.0.10.0050.00216.82
8.0.00.0080.01016.65
7.4.330.0050.00012.88
7.4.320.0030.00316.55
7.4.300.0030.00316.51
7.4.290.0070.00016.36
7.4.280.0080.00016.52
7.4.270.0000.00716.38
7.4.260.0030.00313.14
7.4.250.0000.00816.41
7.4.240.0000.00716.48
7.4.230.0070.00016.39
7.4.220.0120.00616.36
7.4.210.0030.01716.43
7.4.200.0000.00716.30
7.4.190.0000.00816.57
7.4.160.0060.00916.48
7.4.150.0070.01016.34
7.4.140.0100.01317.86
7.4.130.0110.00816.41
7.4.120.0100.01316.44
7.4.110.0140.00416.53
7.4.100.0070.01016.26
7.4.90.0060.01216.30
7.4.80.0090.00919.39
7.4.70.0040.01116.50
7.4.60.0080.00816.36
7.4.50.0060.00316.22
7.4.40.0080.01116.42
7.4.30.0100.01016.34
7.4.10.0040.01414.88
7.4.00.0070.00814.88
7.3.330.0030.00313.21
7.3.320.0000.00513.20
7.3.310.0000.00716.17
7.3.300.0020.00516.18
7.3.290.0110.00816.22
7.3.280.0170.00316.15
7.3.270.0140.01316.35
7.3.260.0090.01516.20
7.3.240.0060.00916.12
7.3.230.0140.00416.28
7.3.210.0060.01016.37
7.3.200.0060.01316.15
7.3.190.0030.01316.37
7.3.180.0070.01016.20
7.3.170.0120.00416.19
7.3.160.0090.00616.29
7.3.130.0070.01114.73
7.3.120.0070.00714.78
7.3.110.0060.00914.68
7.3.100.0000.01414.79
7.3.90.0000.01514.43
7.3.80.0030.00614.82
7.3.70.0030.01314.79
7.3.60.0110.00414.66
7.3.50.0070.00614.68
7.3.40.0090.00014.77
7.3.30.0060.01014.54
7.3.20.0040.00816.54
7.3.10.0050.01016.47
7.3.00.0060.00716.37
7.2.330.0140.00716.52
7.2.320.0090.00916.30
7.2.310.0070.01016.22
7.2.300.0080.00816.23
7.2.290.0030.01416.49
7.2.260.0060.01214.94
7.2.250.0070.01014.82
7.2.240.0100.00715.07
7.2.230.0030.00614.94
7.2.220.0000.01314.68
7.2.210.0030.01114.99
7.2.200.0060.00314.99
7.2.190.0060.00314.91
7.2.180.0030.01614.93
7.2.170.0110.00414.90
7.2.160.0110.00314.83
7.2.150.0120.00016.78
7.2.140.0070.00716.52
7.2.130.0050.01016.62
7.2.120.0100.00116.50
7.2.110.0060.00716.56
7.2.100.0040.00716.83
7.2.90.0060.00616.77
7.2.80.0090.00516.68
7.2.70.0070.00516.71
7.2.60.0080.00416.83
7.2.50.0070.01016.53
7.2.40.0040.00916.68
7.2.30.0060.01016.69
7.2.20.0070.00816.74
7.2.10.0110.00516.50
7.2.00.0070.00717.47
7.1.330.0000.01315.32
7.1.320.0030.01315.58
7.1.310.0040.00815.88
7.1.300.0120.00415.57
7.1.290.0060.00815.61
7.1.280.0030.01015.60
7.1.270.0040.00915.30
7.1.260.0030.00815.53
7.1.250.0040.00715.54
7.1.240.0030.00915.64
7.1.230.0040.00715.70
7.1.220.0040.00815.60
7.1.210.0090.00615.59
7.1.200.0030.00915.75
7.1.190.0030.01015.75
7.1.180.0060.00615.46
7.1.170.0070.00715.52
7.1.160.0030.01015.75
7.1.150.0070.01015.60
7.1.140.0090.00315.52
7.1.130.0030.00715.50
7.1.120.0060.00915.67
7.1.110.0030.01015.30
7.1.100.0010.00816.73
7.1.90.0080.00315.62
7.1.80.0000.01415.61
7.1.70.0020.01016.33
7.1.60.0090.01017.45
7.1.50.0000.01616.38
7.1.40.0070.00415.51
7.1.30.0100.00315.79
7.1.20.0080.00815.68
7.1.10.0030.01315.51
7.1.00.0020.04519.06
7.0.330.0050.00315.15
7.0.320.0140.00015.02
7.0.310.0040.00715.14
7.0.300.0040.01115.27
7.0.290.0030.00714.99
7.0.280.0060.00615.15
7.0.270.0030.00715.22
7.0.260.0030.01015.29
7.0.250.0000.01414.98
7.0.240.0030.00615.26
7.0.230.0120.00415.25
7.0.220.0000.01215.24
7.0.210.0040.00815.23
7.0.200.0030.00816.04
7.0.190.0110.00015.35
7.0.180.0130.00315.27
7.0.170.0060.00615.29
7.0.160.0090.00315.38
7.0.150.0000.01015.01
7.0.140.0030.04118.69
7.0.130.0100.00715.31
7.0.120.0020.04218.67
7.0.110.0060.00615.38
7.0.100.0070.01015.43
7.0.90.0060.00315.30
7.0.80.0030.00615.46
7.0.70.0000.01015.45
7.0.60.0050.04517.53
7.0.50.0100.03416.60
7.0.40.0070.04716.76
7.0.30.0170.04216.86
7.0.20.0190.04216.56
7.0.10.0140.04016.71
7.0.00.0070.04516.69
5.6.400.0120.00314.05
5.6.390.0080.00013.95
5.6.380.0060.00814.08
5.6.370.0030.01014.19
5.6.360.0000.01014.35
5.6.350.0060.00614.34
5.6.340.0000.01313.95
5.6.330.0070.00714.51
5.6.320.0000.01114.22
5.6.310.0040.01213.82
5.6.300.0060.00314.31
5.6.290.0030.00914.25
5.6.280.0000.00914.29
5.6.270.0030.01014.50
5.6.260.0070.00714.23
5.6.250.0000.01314.07
5.6.240.0080.00313.96
5.6.230.0000.01514.01
5.6.220.0030.00914.21
5.6.210.0050.02717.38
5.6.200.0030.02716.09
5.6.190.0120.02317.26
5.6.180.0170.04517.38
5.6.170.0210.04017.41
5.6.160.0070.03217.40
5.6.150.0100.03916.12
5.6.140.0080.04416.18
5.6.130.0050.04616.16
5.6.120.0010.04317.41
5.6.110.0050.04717.59
5.6.100.0070.03017.52
5.6.90.0030.04817.67
5.6.80.0030.04417.14
5.6.70.1830.01717.17
5.6.60.0070.01013.97
5.6.50.0130.00314.09
5.6.40.0100.00313.83
5.6.30.0040.01113.93
5.6.20.0060.00613.91
5.6.10.0060.00814.14
5.6.00.0000.01314.07
5.5.380.0070.00714.41
5.5.370.0100.00313.81
5.5.360.0060.00313.99
5.5.350.0100.02417.20
5.5.340.0070.03715.97
5.5.330.0020.03117.18
5.5.320.0220.01517.19
5.5.310.0150.04417.17
5.5.300.0080.03816.17
5.5.290.0050.04316.14
5.5.280.0120.04017.45
5.5.270.0030.02717.44
5.5.260.0050.04817.47
5.5.250.0050.02817.31
5.5.240.0050.04516.91
5.5.230.0070.01013.89
5.5.220.0030.00614.17
5.5.210.0030.01013.75
5.5.200.0060.00613.82
5.5.190.0030.00914.20
5.5.180.0060.00614.05
5.5.170.0000.01113.81
5.5.160.0000.00814.19
5.5.150.0120.00413.98
5.5.140.0070.01014.22
5.5.130.0100.00713.86
5.5.120.0060.00614.11
5.5.110.0060.00613.92
5.5.100.0060.00914.00
5.5.90.0030.00913.99
5.5.80.0000.01414.04
5.5.70.0000.01014.22
5.5.60.0060.00813.96
5.5.50.0000.00814.11
5.5.40.0040.00713.80
5.5.30.0060.00313.98
5.5.20.0040.00414.14
5.5.10.0030.00713.83
5.5.00.0040.01113.76
5.4.450.0030.02615.80
5.4.440.0070.03915.80
5.4.430.0020.02215.65
5.4.420.0030.02515.85
5.4.410.0080.02715.73
5.4.400.0020.04515.53
5.4.390.0030.03215.55
5.4.380.0070.03715.64
5.4.370.0030.03015.64
5.4.360.0050.04015.60
5.4.350.0030.02215.55
5.4.340.0050.04315.64
5.4.330.0050.00212.13
5.4.320.0050.04315.68
5.4.310.0050.04015.59
5.4.300.0070.03415.49
5.4.290.0080.03715.69
5.4.280.0050.02815.57
5.4.270.0100.03315.49
5.4.260.0050.04215.68
5.4.250.0030.02515.55
5.4.240.0050.03615.63
5.4.230.0050.04315.63
5.4.220.0050.03815.64
5.4.210.0030.02215.63
5.4.200.0050.03215.48
5.4.190.0050.04115.63
5.4.180.0050.02315.68
5.4.170.0080.03315.61
5.4.160.0070.02815.64
5.4.150.0130.03515.48
5.4.140.0020.02414.32
5.4.130.0060.02614.23
5.4.120.0040.03414.29
5.4.110.0050.04014.23
5.4.100.0060.03814.28
5.4.90.0060.02214.25
5.4.80.0080.03714.25
5.4.70.0080.03014.26
5.4.60.0020.03014.24
5.4.50.0030.04314.24
5.4.40.0080.03614.20
5.4.30.0060.02714.37
5.4.20.0000.03814.25
5.4.10.0070.02314.19
5.4.00.0110.02813.94
5.3.290.0100.06714.57
5.3.280.0030.06014.62
5.3.270.0100.05014.51
5.3.260.0070.06714.68
5.3.250.0100.07314.67
5.3.240.0030.08014.53
5.3.230.0000.08014.67
5.3.220.0030.05714.63
5.3.210.0100.07314.50
5.3.200.0100.06014.73
5.3.190.0100.07714.64
5.3.180.0070.06014.58
5.3.170.0130.06714.59
5.3.160.0070.06014.59
5.3.150.0030.06014.59
5.3.140.0100.06714.59
5.3.130.0030.04314.63
5.3.120.0030.08314.58
5.3.110.0100.06314.64
5.3.100.0070.04014.05
5.3.90.0070.03314.07
5.3.80.0070.03714.19
5.3.70.0100.03014.03
5.3.60.0030.05714.02
5.3.50.0030.07014.14
5.3.40.0130.02714.11
5.3.30.0100.03313.90
5.3.20.0070.07313.75
5.3.10.0130.06313.66
5.3.00.0070.05313.68
5.2.170.0030.06311.33
5.2.160.0000.03311.22
5.2.150.0000.04311.05
5.2.140.0000.03711.31
5.2.130.0000.06311.19
5.2.120.0100.05311.18
5.2.110.0100.05711.19
5.2.100.0070.05711.30
5.2.90.0170.05711.12
5.2.80.0070.03311.17
5.2.70.0030.06311.28
5.2.60.0070.06311.03
5.2.50.0000.03311.09
5.2.40.0070.05711.01
5.2.30.0070.02710.91
5.2.20.0030.03011.14
5.2.10.0030.02710.84
5.2.00.0000.03010.81
5.1.60.0030.05710.06
5.1.50.0030.05310.03
5.1.40.0030.02310.02
5.1.30.0100.04010.43
5.1.20.0070.05310.26
5.1.10.0030.04710.09
5.1.00.0000.05310.15
5.0.50.0030.0478.53
5.0.40.0000.0338.59
5.0.30.0000.0478.27
5.0.20.0030.0178.27
5.0.10.0070.0378.16
5.0.00.0130.0378.21
4.4.90.0000.0178.07
4.4.80.0000.0338.07
4.4.70.0030.0278.07
4.4.60.0000.0278.07
4.4.50.0030.0138.07
4.4.40.0070.0508.07
4.4.30.0070.0178.07
4.4.20.0070.0338.07
4.4.10.0070.0178.07
4.4.00.0030.0538.07
4.3.110.0030.0308.07
4.3.100.0000.0208.07
4.3.90.0030.0138.07
4.3.80.0030.0538.07
4.3.70.0000.0238.07
4.3.60.0070.0308.07
4.3.50.0100.0278.07
4.3.40.0000.0438.07
4.3.30.0030.0308.07
4.3.20.0000.0178.07
4.3.10.0000.0338.07
4.3.00.0000.0208.07

preferences:
43.89 ms | 400 KiB | 5 Q