3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Factory for search endpoints. */ class SearchEndpointFactory { /** * @var array Holds namespaces for endpoints. */ private static $endpoints = [ 'query' => 'ONGR\ElasticsearchDSL\SearchEndpoint\QueryEndpoint', 'post_filter' => 'ONGR\ElasticsearchDSL\SearchEndpoint\PostFilterEndpoint', 'sort' => 'ONGR\ElasticsearchDSL\SearchEndpoint\SortEndpoint', 'highlight' => 'ONGR\ElasticsearchDSL\SearchEndpoint\HighlightEndpoint', 'aggregations' => 'ONGR\ElasticsearchDSL\SearchEndpoint\AggregationsEndpoint', 'suggest' => 'ONGR\ElasticsearchDSL\SearchEndpoint\SuggestEndpoint', 'inner_hits' => 'ONGR\ElasticsearchDSL\SearchEndpoint\InnerHitsEndpoint', ]; /** * Returns a search endpoint instance. * * @param string $type Type of endpoint. * * @return SearchEndpointInterface * * @throws \RuntimeException Endpoint does not exist. */ public static function get($type) { if (!array_key_exists($type, self::$endpoints)) { throw new \RuntimeException('Endpoint does not exist.'); } var_dump((self::$endpoints[$type])); die; return new (self::$endpoints[$type])(); } } var_dump(SearchEndpointFactory::get('query'));

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.0330.01016.94
8.5.20.0370.00616.76
8.5.10.0350.01016.77
8.5.00.0330.00816.55
8.4.180.0310.00819.68
8.4.170.0310.00719.61
8.4.160.0190.01119.52
8.4.150.0130.00919.63
8.4.140.0270.00817.68
8.4.130.0290.00817.59
8.4.120.0240.00917.88
8.4.110.0280.01117.75
8.4.100.0170.00617.73
8.4.90.0200.00617.66
8.4.80.0260.00517.79
8.4.70.0190.00417.86
8.4.60.0170.00617.66
8.4.50.0340.00817.84
8.4.40.0370.01017.70
8.4.30.0400.00917.89
8.4.20.0270.00717.68
8.4.10.0190.00417.75
8.3.300.0130.00618.48
8.3.290.0310.00518.47
8.3.280.0310.00818.39
8.3.270.0400.00916.49
8.3.260.0340.00716.55
8.3.250.0230.00516.77
8.3.240.0160.00416.75
8.3.230.0210.00716.74
8.3.220.0230.00816.66
8.3.210.0210.00716.60
8.3.200.0230.00816.66
8.3.190.0310.00516.74
8.3.180.0380.01216.58
8.3.170.0330.01116.44
8.3.160.0390.01216.75
8.3.150.0260.00816.64
8.3.140.0200.00416.45
8.3.130.0230.00316.50
8.3.120.0290.00816.80
8.3.110.0300.00416.52
8.3.100.0280.00416.63
8.3.90.0240.00616.50
8.3.80.0190.00416.75
8.3.70.0170.00416.74
8.3.60.0180.00416.93
8.3.50.0220.00916.81
8.3.40.0200.00517.68
8.3.30.0260.00517.90
8.3.20.0150.00417.91
8.3.10.0260.00417.60
8.3.00.0280.00918.04

preferences:
55.83 ms | 710 KiB | 5 Q