3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Template Name: Firma Ekle */ ?> <?php if(!is_user_logged_in()) { wp_redirect(home_url()); } if(isset($_POST['sfr_task']) && $_POST['sfr_task'] == 'addfirma' && isset( $_POST['sfr_addfirma_nonce_field'] ) && wp_verify_nonce( $_POST['sfr_addfirma_nonce_field'], 'sfr_addfirma_nonce' ) ) { $result = array(); $title = wp_strip_all_tags(sanitize_text_field($_POST['sfr_title'])); $category = sanitize_text_field($_POST['sfr_category']); $goldcategory = sanitize_text_field($_POST['sfr_goldcategory']); $content = $_POST['sfr_newscontent']; $address = wp_strip_all_tags(sanitize_text_field($_POST['sfr_address'])); $phone = wp_strip_all_tags(sanitize_text_field($_POST['sfr_phone'])); $fax = wp_strip_all_tags(sanitize_text_field($_POST['sfr_fax'])); $mail = wp_strip_all_tags(sanitize_text_field($_POST['sfr_mail'])); $website = wp_strip_all_tags(sanitize_text_field($_POST['sfr_website'])); $facebook = wp_strip_all_tags(sanitize_text_field($_POST['sfr_facebook'])); $twitter = wp_strip_all_tags(sanitize_text_field($_POST['sfr_twitter'])); $gplus = wp_strip_all_tags(sanitize_text_field($_POST['sfr_gplus'])); $tags = sanitize_text_field($_POST['sfr_tags']); $maps = sanitize_text_field($_POST['sfr_maps']); $video = ($_POST['sfr_video']); if($title == '' || $address == '' || $content == '') { $result = array('class'=>'status warning', 'message'=>'Firma ünvanı, firma adresi ve içerik alanı zorunludur.'); } else { global $current_user; get_currentuserinfo(); $authorID = $current_user->ID; $categories = array($category); if( get_user_meta($authorID, 'premium', true) && $goldcategory == 1 ) { $categories[] = xoption('firmaGoldCategory'); } if(current_user_can('administrator')) { $post_status = 'publish'; } else { $post_status = xoption('profilePostStatus'); } $postArgs = array( 'post_title' => $title, 'post_content' => $content, 'post_status' => $post_status, 'post_author' => $authorID, 'post_category' => $categories, 'tags_input' => $tags, 'comment_status'=> 'open' ); $doUpdate = false; $attachmentIDs = array(); $uploadCounter = 0; foreach( $_FILES as $file ) { if( is_array( $file ) && $file['name'] ) { $uploadCounter++; $allowed = array('gif','png','jpg'); $filename = $file['name']; $filesize = $file['size']; $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); if( $file['error'] == 0 && in_array($ext, $allowed) && $filesize < SAFIR_MAX_UPLOAD_SIZE ) { $attachmentIDs[] = upload_user_file( $file ); } } } if(count($attachmentIDs) == $uploadCounter) { $doUpdate = true; } else { $doUpdate = false; $result = array('class'=>'status warning', 'message'=>'Bazı resimler yüklenemedi. Lütfen dosya uzantısına ve boyutun en fazla 1 MB olmasına dikkat ediniz.'); foreach ($attachmentIDs as $attachmentID) { wp_delete_attachment($attachmentID, true); } } if($doUpdate) { $postID = wp_insert_post( $postArgs ); if( is_wp_error($postID) ) { $result = array('class'=>'status warning', 'message'=>$postID->get_error_message()); } else { $counter = 0; if(count($attachmentIDs) > 0) { foreach ($attachmentIDs as $attachmentID) { $counter++; if($counter == 1) { add_post_meta($postID, '_thumbnail_id', $attachmentID); } else { $image = wp_get_attachment_image_src($attachmentID, 'full'); add_post_meta($postID, constant('SAFIR_FIRMA_RESIM' . $counter), $image[0]); wp_update_post( array( 'ID' => $attachmentID, 'post_parent' => $postID ) ); } } } if($address) add_post_meta($postID, SAFIR_FIRMA_ADRES, $address); if($phone) add_post_meta($postID, SAFIR_FIRMA_PHONE, $phone); if($fax) add_post_meta($postID, SAFIR_FIRMA_FAX, $fax); if($mail) add_post_meta($postID, SAFIR_FIRMA_EMAIL, $mail); if($website) add_post_meta($postID, SAFIR_FIRMA_WEBSITE, $website); if($facebook) add_post_meta($postID, SAFIR_FIRMA_FACEBOOK, $facebook); if($twitter) add_post_meta($postID, SAFIR_FIRMA_TWITTER, $twitter); if($gplus) add_post_meta($postID, SAFIR_FIRMA_GPLUS, $gplus); if($maps) add_post_meta($postID, SAFIR_FIRMA_MAPS, $maps); if($video) add_post_meta($postID, SAFIR_FIRMA_VIDEO, $video); $message = 'Firma başarılı bir şekilde eklendi.'; if($post_status == 'draft') { $message .= ' Yönetici onayından sonra yayınlanacaktır.'; } else { $message .= ' <a rel="external" href="'. get_permalink($postID). '">Konuyu Görüntüle</a>'; } $result = array('class'=>'status success', 'message'=> $message); if(xoption('sendMailtoAdminAdd')) include('sendmailtoadmin.php'); } } } } ?> <?php get_header() ?> <h1 class="mainHeading"><?php the_title() ?></h1> <div id="profile" class="addfirma"> <?php global $current_user; get_currentuserinfo(); $authorID = $current_user->ID; if($content == '') $content = 'Firma hakkında bilgiyi buraya yazınız'; ?> <div class="sfrIconForm"> <form class="addfirma" method="post" enctype="multipart/form-data"> <?php if(!$result) { $result = array('class' => 'status', 'message' => 'Firma ile ilgili bilgileri aşağıdaki forma ekleyiniz.'); } ?> <?php if(xoption('firmaPage') != "-1") : ?><a class="safirButton list shiftbottom" href="<?php echo get_permalink(xoption('firmaPage')) ?>">Eklediğim Firmaları Listele</a><?php endif; ?> <p class="<?php echo $result['class'] ?>"><?php echo $result['message'] ?></p> <div class="container"> <div class="itemContainer"> <div class="item pen"> <div class="icon"><span></span></div> <input name="sfr_title" type="text" placeholder="Firma Ünvanı *" value="<?php echo $title ?>" /> </div> </div> <div class="itemContainer"> <div class="item address"> <div class="icon"><span></span></div> <input name="sfr_address" type="text" placeholder="Firma Adresi *" value="<?php echo $address ?>" /> </div> </div> <div class="container"> <div class="itemContainer"> <div class="item tag"> <div class="icon"><span></span></div> <input name="sfr_tags" type="text" placeholder="İlçe Adı" value="<?php echo $tags ?>" /> </div> </div></div> <?php if( get_user_meta($authorID, 'premium', true) ) : ?> <div class="itemContainer"> <div class="item category"> <div class="icon"><span></span></div> <select name="sfr_goldcategory"> <option value="1"<?php if($goldcategory == 1) echo ' selected'; ?>> Bu firma Gold Firmalar kategorisine de eklensin. </option> <option value="0"<?php if($goldcategory == 0) echo ' selected'; ?>> Bu firma Gold Firmalar kategorisine eklenmesin. </option> ?> </select> </div> </div> <?php endif; ?> </div> <div class="container half"> <div class="itemContainer"> <div class="item category"> <div class="icon"><span></span></div> <select name="sfr_category"> <?php $categories = xoption('profileFirmaCategories'); foreach ($categories as $catID) {?> <option value="<?php echo $catID ?> "<?php if($category == $catID) echo ' selected'; ?>><?php echo get_cat_name($catID) ?></option> <?php } ?> </select> </div> </div> <div class="itemContainer"> <div class="item phone"> <div class="icon"><span></span></div> <input name="sfr_phone" type="text" placeholder="Firma Telefon Numarası" value="<?php echo $phone ?>" /> </div> </div> <div class="itemContainer"> <div class="item fax"> <div class="icon"><span></span></div> <input name="sfr_fax" type="text" placeholder="Firma Faks Numarası" value="<?php echo $fax ?>" /> </div> </div> <div class="itemContainer"> <div class="item mail"> <div class="icon"><span></span></div> <input name="sfr_mail" type="text" placeholder="Firma E-posta Adresi" value="<?php echo $mail ?>" /> </div> </div> </div> <div class="container"> <div class="itemContainer"> <div class="item image"> <div class="icon"><span></span></div> <label class="fileLabel" for="file.newsImage0"><span class="text">Firma Kapak Resmi</span><span class="button">Resim Seç</span></label><input id="file.newsImage0" name="sfr_image0" type="file" accept="image/*" /> </div> </div> </div> <div class="container"> <div class="itemContainer"> <div class="item website"> <div class="icon"><span></span></div> <input name="sfr_website" type="text" placeholder="Firma Website Adresi (http://site.com formatında)" value="<?php echo $website ?>" /> </div> </div> <div class="itemContainer"> <div class="item facebook"> <div class="icon"><span></span></div> <input name="sfr_facebook" type="text" placeholder="Firma Facebook Adresi (http://site.com formatında)" value="<?php echo $facebook ?>" /> </div> </div> <div class="itemContainer"> <div class="item twitter"> <div class="icon"><span></span></div> <input name="sfr_twitter" type="text" placeholder="Firma Twitter Adresi (http://site.com formatında)" value="<?php echo $twitter ?>" /> </div> </div> <div class="itemContainer"> <div class="item gplus"> <div class="icon"><span></span></div> <input name="sfr_gplus" type="text" placeholder="Firma Google+ Adresi (http://site.com formatında)" value="<?php echo $gplus ?>" /> </div> </div> <div class="container"> <div class="itemContainer"> <div class="item maps"> <p style="margin-left:10px;">Firma Konumu</p> <div id="googleMap" style="height:350px;"></div> <input type="hidden" name="sfr_maps" id="googleMapsInput" /> </div> </div> </div> <div class="container"> <div class="itemContainer"> <div class="item video"> <textarea class="noicon" name="sfr_video" placeholder="Firma Video Embed Kodu"><?php echo $video ?></textarea> </div> </div> </div> sssss <div class="itemContainer"> <div class="item"> <?php wp_editor($content, 'sfr_newscontent', array( 'textarea_rows' => 20, 'media_buttons' => false, 'quicktags' => false, 'tinymce' => array('toolbar1'=> 'formatselect bold italic underline bullist numlist link unlink forecolorc image alignleft aligncenter alignright', 'toolbar2'=>''), )); ?> </div> </div> </div> <input type="hidden" name="sfr_task" value="addfirma"> <input type="submit" value="&#10004; FİRMAYI EKLE"> <?php wp_nonce_field( 'sfr_addfirma_nonce', 'sfr_addfirma_nonce_field' ); ?> </form> </div> </div> </div><!--content--> <?php global $activeMenu; $activeMenu = 'addfirma'; include( TEMPLATEPATH . '/profile/aside.php'); ?> </div> <!--main--> <?php get_footer(); ?> <script src="http://maps.googleapis.com/maps/api/js"></script> <script> function initialize() { var myLatlng = new google.maps.LatLng(39,36); var mapOptions = { zoom: 5, center: myLatlng, draggableCursor: "crosshair", } var map = new google.maps.Map(document.getElementById('googleMap'), mapOptions); var marker = new google.maps.Marker({ position: myLatlng, map: map, }); google.maps.event.addListener(map, 'click', function(location) { var newLatlng = location.latLng marker.setPosition(newLatlng); $('#googleMapsInput').val(newLatlng.lat() + "," + newLatlng.lng()); }); } google.maps.event.addDomListener(window, 'load', initialize); </script>

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.0120.00318.43
8.3.50.0140.00721.32
8.3.40.0110.00718.96
8.3.30.0040.01118.96
8.3.20.0080.00020.40
8.3.10.0040.00421.89
8.3.00.0050.00323.61
8.2.180.0040.01918.29
8.2.170.0150.00622.96
8.2.160.0030.01220.52
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00819.64
8.2.120.0040.00426.35
8.2.110.0000.00922.13
8.2.100.0060.00618.16
8.2.90.0030.00619.22
8.2.80.0040.00418.03
8.2.70.0030.00617.75
8.2.60.0030.00617.93
8.2.50.0000.00818.07
8.2.40.0000.00822.21
8.2.30.0000.00719.54
8.2.20.0080.00017.76
8.2.10.0000.00818.27
8.2.00.0030.00518.16
8.1.280.0070.01425.92
8.1.270.0080.00020.38
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0060.00323.93
8.1.230.0030.00919.27
8.1.220.0090.00017.77
8.1.210.0050.00318.77
8.1.200.0070.00317.38
8.1.190.0040.00417.22
8.1.180.0030.00518.10
8.1.170.0000.00918.77
8.1.160.0070.00020.79
8.1.150.0050.00318.91
8.1.140.0000.00819.69
8.1.130.0030.00317.85
8.1.120.0030.00417.57
8.1.110.0070.00317.55
8.1.100.0000.00717.60
8.1.90.0070.00017.43
8.1.80.0030.00517.45
8.1.70.0070.00017.45
8.1.60.0060.00317.67
8.1.50.0080.00017.51
8.1.40.0040.00417.58
8.1.30.0040.00417.69
8.1.20.0030.00617.56
8.1.10.0030.00517.71
8.1.00.0030.00517.50
8.0.300.0030.00518.77
8.0.290.0050.00316.75
8.0.280.0030.00318.59
8.0.270.0000.00717.31
8.0.260.0000.00717.36
8.0.250.0070.00017.11
8.0.240.0040.00417.12
8.0.230.0030.00317.14
8.0.220.0090.00017.06
8.0.210.0040.00317.08
8.0.200.0000.00817.10
8.0.190.0000.00817.01
8.0.180.0040.00417.07
8.0.170.0030.00616.99
8.0.160.0050.00317.07
8.0.150.0070.00017.00
8.0.140.0030.00616.97
8.0.130.0000.00713.52
8.0.120.0000.00817.03
8.0.110.0000.00716.89
8.0.100.0040.00416.97
8.0.90.0030.00516.94
8.0.80.0060.01516.99
8.0.70.0040.00417.12
8.0.60.0040.00416.96
8.0.50.0040.00416.95
8.0.30.0090.01117.17
8.0.20.0120.00817.40
8.0.10.0070.00017.13
8.0.00.0110.00916.83
7.4.330.0050.00016.75
7.4.320.0050.00316.46
7.4.300.0050.00316.73
7.4.290.0070.00016.72
7.4.280.0030.00616.59
7.4.270.0040.00416.74
7.4.260.0070.00316.57
7.4.250.0040.00416.68
7.4.240.0050.00316.68
7.4.230.0040.00416.75
7.4.220.0090.00816.74
7.4.210.0100.00916.65
7.4.200.0040.00416.72
7.4.160.0150.00316.73
7.4.150.0140.00417.40
7.4.140.0090.00917.86
7.4.130.0080.01016.61
7.4.120.0100.00816.61
7.4.110.0110.00816.93
7.4.100.0030.01416.64
7.4.90.0070.01816.50
7.4.80.0060.01219.39
7.4.70.0160.00816.70
7.4.60.0070.01016.91
7.4.50.0030.00916.45
7.4.40.0090.00816.49
7.4.30.0110.00716.49
7.4.10.0070.01015.33
7.4.00.0050.00815.24
7.3.330.0000.00513.26
7.3.320.0000.00713.18
7.3.310.0050.00216.46
7.3.300.0040.00416.41
7.3.290.0080.00816.41
7.3.280.0130.00416.40
7.3.270.0090.00917.40
7.3.260.0130.00316.36
7.3.250.0170.00316.65
7.3.240.0080.01216.54
7.3.230.0100.00716.39
7.3.210.0190.00016.77
7.3.200.0060.01619.39
7.3.190.0060.01316.51
7.3.180.0160.00016.59
7.3.170.0060.01116.78
7.3.160.0130.00916.38
7.3.130.0170.00314.90
7.3.120.0090.00914.99
7.3.110.0030.01514.91
7.3.100.0100.00714.75
7.3.90.0100.00015.10
7.3.80.0030.01014.92
7.3.70.0080.00414.94
7.3.60.0030.01215.04
7.3.50.0050.00514.98
7.3.40.0060.00614.87
7.3.30.0070.00715.02
7.3.20.0090.00616.71
7.3.10.0050.00816.41
7.3.00.0040.00716.60
7.2.330.0170.00316.39
7.2.320.0070.01116.72
7.2.310.0050.01116.41
7.2.300.0130.00316.72
7.2.290.0100.00716.48
7.2.260.0000.01715.04
7.2.250.0060.01215.19
7.2.240.0100.00715.05
7.2.230.0000.01315.10
7.2.220.0000.01914.67
7.2.210.0000.01014.86
7.2.200.0030.01015.13
7.2.190.0030.01014.96
7.2.180.0080.00815.02
7.2.170.0060.00915.10
7.2.160.0070.00714.83
7.2.150.0100.00716.91
7.2.140.0060.00916.84
7.2.130.0100.00616.82
7.2.120.0050.00816.71
7.2.110.0050.00716.68
7.2.100.0030.01016.80
7.2.90.0030.01016.88
7.2.80.0140.00316.64
7.2.70.0070.00716.76
7.2.60.0110.00716.55
7.2.50.0040.01116.73
7.2.40.0040.01016.78
7.2.30.0030.00816.67
7.2.20.0020.01116.92
7.2.10.0080.00616.81
7.2.00.0040.00817.45
7.1.330.0080.00415.80
7.1.320.0080.00315.79
7.1.310.0030.00615.75
7.1.300.0070.00715.30
7.1.290.0050.00515.46
7.1.280.0110.00315.49
7.1.270.0000.01115.68
7.1.260.0070.00715.61
7.1.250.0050.01015.52
7.1.240.0030.00915.50
7.1.230.0040.00815.64
7.1.220.0070.00715.61
7.1.210.0080.00415.72
7.1.200.0070.00615.55
7.1.190.0090.00315.57
7.1.180.0100.00315.61
7.1.170.0000.01415.68
7.1.160.0080.00715.55
7.1.150.0030.00915.54
7.1.140.0100.00315.65
7.1.130.0070.00315.61
7.1.120.0120.00315.63
7.1.110.0000.00915.69
7.1.100.0000.01116.83
7.1.90.0070.00715.37
7.1.80.0060.00615.42
7.1.70.0050.01016.31
7.1.60.0070.01317.27
7.1.50.0050.01216.25
7.1.40.0060.00915.44
7.1.30.0120.00315.34
7.1.20.0100.00315.35
7.1.10.0000.01415.48
7.1.00.0020.04619.13
7.0.330.0100.00314.95
7.0.320.0070.00315.29
7.0.310.0120.00315.16
7.0.300.0040.00815.33
7.0.290.0060.01015.25
7.0.280.0070.00715.12
7.0.270.0030.00915.24
7.0.260.0100.00315.07
7.0.250.0030.01215.17
7.0.240.0130.00315.35
7.0.230.0000.01015.39
7.0.220.0070.00715.24
7.0.210.0060.00314.99
7.0.200.0070.00416.09
7.0.190.0110.00715.14
7.0.180.0070.00715.34
7.0.170.0040.00815.32
7.0.160.0070.00715.31
7.0.150.0030.01115.21
7.0.140.0030.01215.18
7.0.130.0030.00615.39
7.0.120.0060.00315.32
7.0.110.0030.01315.30
7.0.100.0080.04417.77
7.0.90.0050.04617.60
7.0.80.0050.04417.88
7.0.70.0020.04617.70
7.0.60.0070.04517.71
7.0.50.0090.02717.88
7.0.40.0050.02716.79
7.0.30.0070.04716.54
7.0.20.0100.03516.77
7.0.10.0070.04516.70
7.0.00.0070.04716.75
5.6.400.0020.01314.05
5.6.390.0000.01114.14
5.6.380.0070.00314.24
5.6.370.0100.00314.45
5.6.360.0000.01313.75
5.6.350.0090.00614.38
5.6.340.0030.01314.16
5.6.330.0000.01714.04
5.6.320.0040.01114.19
5.6.310.0030.01414.39
5.6.300.0060.01114.53
5.6.290.0030.00614.41
5.6.280.0000.02717.70
5.6.270.0060.00914.14
5.6.260.0030.00714.14
5.6.250.0080.04517.45
5.6.240.0070.04617.48
5.6.230.0050.04417.43
5.6.220.0080.04717.52
5.6.210.0090.03017.47
5.6.200.0100.03217.57
5.6.190.0070.04517.76
5.6.180.0000.03017.75
5.6.170.0070.03917.68
5.6.160.0070.04617.65
5.6.150.0050.02717.84
5.6.140.0070.04217.60
5.6.130.0070.03917.67
5.6.120.0080.03017.73
5.6.110.0080.03117.69
5.6.100.0100.04317.51
5.6.90.0100.02617.59
5.6.80.0020.04617.23
5.6.70.0130.03617.34
5.6.60.0100.03817.41
5.6.50.0050.03517.22
5.6.40.0030.04817.29
5.6.30.0120.04217.26
5.6.20.0100.03717.30
5.6.10.0070.04117.19
5.6.00.0070.04517.28
5.5.380.0080.03817.33
5.5.370.0060.04817.18
5.5.360.0070.04017.39
5.5.350.0120.04917.25
5.5.340.0060.03817.56
5.5.330.0120.03817.59
5.5.320.0080.04117.35
5.5.310.0070.02717.47
5.5.300.0080.04517.56
5.5.290.0060.03017.49
5.5.280.0030.02817.64
5.5.270.0140.04117.52
5.5.260.0060.03117.49
5.5.250.0070.03817.27
5.5.240.0120.03817.25
5.5.230.0100.03217.25
5.5.220.0080.03617.23
5.5.210.0060.02717.14
5.5.200.0030.04517.11
5.5.190.0100.03717.15
5.5.180.0130.03517.22
5.5.170.0000.01613.89
5.5.160.0090.04117.13
5.5.150.0010.04117.10
5.5.140.0080.03717.05
5.5.130.0030.02817.00
5.5.120.0060.02917.27
5.5.110.0070.03317.12
5.5.100.0030.04616.97
5.5.90.0100.04017.19
5.5.80.0030.02817.04
5.5.70.0050.02817.14
5.5.60.0110.03517.19
5.5.50.0080.03816.99
5.5.40.0090.03317.18
5.5.30.0100.04717.11
5.5.20.0080.03917.07
5.5.10.0070.04216.92
5.5.00.0070.04417.03

preferences:
56.42 ms | 401 KiB | 5 Q