3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Api { /** API URL */ public $api_url = 'https://wksmm.com/api/v2'; /** Your API key */ public $api_key = ''; /** Add order */ public function order($data) { $post = array_merge(['key' => $this->api_key, 'action' => 'add'], $data); return json_decode($this->connect($post)); } /** Get order status */ public function status($order_id) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'status', 'order' => $order_id ]) ); } /** Get orders status */ public function multiStatus($order_ids) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'status', 'orders' => implode(",", (array)$order_ids) ]) ); } /** Get services */ public function services() { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'services', ]) ); } /** Refill order */ public function refill(int $orderId) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'refill', 'order' => $orderId, ]) ); } /** Refill orders */ public function multiRefill(array $orderIds) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'refill', 'orders' => implode(',', $orderIds), ]), true, ); } /** Get refill status */ public function refillStatus(int $refillId) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'refill_status', 'refill' => $refillId, ]) ); } /** Get refill statuses */ public function multiRefillStatus(array $refillIds) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'refill_status', 'refills' => implode(',', $refillIds), ]), true, ); } /** Cancel orders */ public function cancel(array $orderIds) { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'cancel', 'orders' => implode(',', $orderIds), ]), true, ); } /** Get balance */ public function balance() { return json_decode( $this->connect([ 'key' => $this->api_key, 'action' => 'balance', ]) ); } private function connect($post) { $_post = []; if (is_array($post)) { foreach ($post as $name => $value) { $_post[] = $name . '=' . urlencode($value); } } $ch = curl_init($this->api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); if (is_array($post)) { curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $_post)); } curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'); $result = curl_exec($ch); if (curl_errno($ch) != 0 && empty($result)) { $result = false; } curl_close($ch); return $result; } } // Examples $api = new Api(); $services = $api->services(); # Return all services $balance = $api->balance(); # Return user balance // Add order $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 2, 'interval' => 5]); # Default $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'keywords' => "test, testing"]); # SEO $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'comments' => "good pic\ngreat photo\n:)\n;)"]); # Custom Comments $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'usernames' => "test, testing", 'hashtags' => "#goodphoto"]); # Mentions with Hashtags $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'usernames' => "test\nexample\nfb"]); # Mentions Custom List $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'hashtag' => "test"]); # Mentions Hashtag $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'username' => "test"]); # Mentions User Followers $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'media' => "http://example.com/p/Ds2kfEr24Dr"]); # Mentions Media Likers $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'usernames' => "test"]); # Mentions $order = $api->order(['service' => 1, 'link' => 'http://example.com/test']); # Package $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 10, 'interval' => 60]); # Drip-feed // Old posts only $order = $api->order(['service' => 1, 'username' => 'username', 'min' => 100, 'max' => 110, 'posts' => 0, 'delay' => 30, 'expiry' => '11/11/2022']); # Subscriptions // Unlimited new posts and 5 old posts $order = $api->order(['service' => 1, 'username' => 'username', 'min' => 100, 'max' => 110, 'old_posts' => 5, 'delay' => 30, 'expiry' => '11/11/2022']); # Subscriptions $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'username' => "test"]); # Comment Likes $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'answer_number' => '7']); # Poll $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'groups' => "group1\ngroup2"]); # Invites from Groups $status = $api->status($order->order); # Return status, charge, remains, start count, currency $statuses = $api->multiStatus([1, 2, 3]); # Return orders status, charge, remains, start count, currency $refill = (array) $api->multiRefill([1, 2]); $refillIds = array_column($refill, 'refill'); if ($refillIds) { $refillStatuses = $api->multiRefillStatus($refillIds); }

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.30.0080.01021.23
8.5.20.0120.00520.14
8.5.10.0110.00716.80
8.5.00.0130.00920.27
8.4.180.0110.01121.78
8.4.170.0100.01124.17
8.4.160.0110.01124.09
8.4.150.0070.00616.99
8.4.140.0090.01317.97
8.4.130.0060.00418.78
8.4.120.0040.00724.16
8.4.110.0140.00618.88
8.4.100.0110.00618.74
8.4.90.0100.01120.79
8.4.80.0090.00318.95
8.4.70.0090.00818.93
8.4.60.0140.00718.77
8.4.50.0070.00720.53
8.4.40.0070.01318.00
8.4.30.0140.00718.71
8.4.20.0060.00319.63
8.4.10.0080.00019.85
8.3.300.0090.01419.31
8.3.290.0090.01120.85
8.3.280.0180.00418.70
8.3.270.0140.00516.88
8.3.260.0100.00916.83
8.3.250.0110.00619.28
8.3.240.0090.01117.25
8.3.230.0060.00516.65
8.3.220.0090.00718.86
8.3.210.0090.01018.62
8.3.200.0020.00717.07
8.3.190.0090.00920.97
8.3.180.0110.00519.19
8.3.170.0000.00919.16
8.3.160.0080.00018.41
8.3.150.0070.00717.14
8.3.140.0150.00416.79
8.3.130.0000.01016.74
8.3.120.0090.00620.60
8.3.110.0000.00816.87
8.3.100.0080.01118.53
8.3.90.0040.01516.97
8.3.80.0340.01430.84
8.3.70.0410.00730.84
8.3.60.0340.01330.84
8.3.50.0130.01330.84
8.3.40.0330.00930.84
8.3.30.0390.00330.84
8.3.20.0420.00630.84
8.3.10.0350.01030.84
8.3.00.0450.00030.84
8.2.300.0110.00922.11
8.2.290.0060.00322.14
8.2.280.0070.00918.64
8.2.270.0070.01117.29
8.2.260.0080.00018.57
8.2.250.0080.00016.83
8.2.240.0030.00617.16
8.2.230.0080.00020.94
8.2.220.0100.00624.06
8.2.210.0110.00726.77
8.2.200.0200.00430.84
8.2.190.0220.00030.84
8.2.180.0140.00530.84
8.2.170.0210.00930.84
8.2.160.0200.00330.84
8.2.150.0200.00030.84
8.2.140.0230.01230.84
8.2.130.0420.00730.84
8.2.120.0390.00330.84
8.2.110.0340.01030.84
8.2.100.0380.00630.84
8.2.90.0430.00030.84
8.2.80.0380.00330.84
8.2.70.0280.00930.84
8.2.60.0280.00730.84
8.2.50.0350.00730.84
8.2.40.0380.00330.84
8.2.30.0290.01130.84
8.2.20.0370.00630.84
8.2.10.0310.01130.84
8.2.00.0500.00830.84
8.1.340.0110.00917.79
8.1.330.0100.01022.01
8.1.320.0090.01016.31
8.1.310.0120.00618.32
8.1.300.0090.00916.71
8.1.290.0340.01030.84
8.1.280.0250.01830.84
8.1.270.0320.00730.84
8.1.260.0330.00430.84
8.1.250.0400.00330.84
8.1.240.0310.00830.84
8.1.230.0340.00430.84
8.1.220.0230.01530.84
8.1.210.0320.00730.84
8.1.200.0380.00330.84
8.1.190.0320.00930.84
8.1.180.0350.00930.84
8.1.170.0320.00630.84
8.1.160.0320.00430.84
8.1.150.0120.00630.84
8.1.140.0370.00730.84
8.1.130.0370.00330.84
8.1.120.0310.00730.84
8.1.110.0290.00930.84
8.1.100.0320.00330.84
8.1.90.0260.00730.84
8.1.80.0280.01230.84
8.1.70.0290.00430.84
8.1.60.0250.00930.84
8.1.50.0390.00730.84
8.1.40.0310.01030.84
8.1.30.0450.00330.84
8.1.20.0440.00630.84
8.1.10.0320.01130.84
8.1.00.0260.01630.84

preferences:
44.88 ms | 1002 KiB | 5 Q