3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * Google font management */ $yith_google_fonts = new Google_Font(); class Google_Font { /** * @var array The google fonts to include in the page */ public $google_fonts = array(); /** * Generate the url for the google fonts */ public function google_fonts_url() { $base_url = '//fonts.googleapis.com/css?family='; $fonts = array(); if ( empty( $this->google_fonts ) ) return; foreach ( $this->google_fonts as $font => $variants ) { $fonts[] = urlencode( $font . ':' . implode( ',', $variants ) ); } return $base_url . implode( '|', $fonts ); } /** * Add a new google font in queue * * @param $font The name of google font * @param array $variants The variatns for the google font to add */ public function add_google_font( $font, $variants = array() ) { if ( ! is_array( $variants ) ) $variants = array( $variants ); foreach ( $variants as $variant ) { if ( ! isset( $this->google_fonts[$font] ) ) $this->google_fonts[$font] = array( 300, 400 ); if ( ! in_array( $variant, $this->google_fonts[$font] ) ) $this->google_fonts[$font][] = $variant; } } } if ( ! function_exists( 'yith_add_google_font' ) ) { /** * Add a new google font in queue * * @param $font The name of google font * @param array $variant The variatns for the google font to add */ function yith_add_google_font( $font, $variant = array() ) { global $yith_google_fonts; $yith_google_fonts->add_google_font( $font, $variant ); } } if ( ! function_exists( 'yith_google_fonts_url' ) ) { /** * @return string The url with the google fonts to load */ function yith_google_fonts_url() { global $yith_google_fonts; return $yith_google_fonts->google_fonts_url(); } }

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.70.0170.01014.88
7.2.60.0860.00715.05
7.2.50.0260.00314.60
7.2.40.0240.00314.66
7.2.30.0190.00814.93
7.2.20.0350.00614.96
7.2.10.0160.01314.69
7.2.00.0200.00714.72
7.1.200.0070.00715.41
7.1.170.0230.00813.88
7.1.160.0180.00913.14
7.1.150.0180.00913.59
7.1.140.0220.00713.82
7.1.130.0180.00913.54
7.1.120.0160.01013.66
7.1.110.0280.01213.63
7.1.100.0200.00613.61
7.1.90.0450.00313.38
7.1.80.0370.00713.73
7.1.70.0450.00813.73
7.1.60.0690.02231.51
7.1.50.0840.01431.73
7.1.40.0710.01131.97
7.1.30.0660.01831.57
7.1.20.0690.01531.81
7.1.10.0520.00613.87
7.1.00.0520.00313.66
7.0.300.0250.00613.50
hhvm-3.22.00.1240.27890.40
hhvm-3.21.30.1190.30989.90
hhvm-3.18.50.1350.29987.91
5.6.300.0040.01414.36