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(); } }
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
Jump found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 10
filename:       /in/KSJuf
function name:  (null)
number of ops:  17
compiled vars:  !0 = $yith_google_fonts
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   6     0  E >   NEW                                              $1      :-5
         1        DO_FCALL                                      0          
         2        ASSIGN                                                   !0, $1
   8     3        NOP                                                      
  47     4        INIT_FCALL                                               'function_exists'
         5        SEND_VAL                                                 'yith_add_google_font'
         6        DO_ICALL                                         $5      
         7        BOOL_NOT                                         ~6      $5
         8      > JMPZ                                                     ~6, ->10
  54     9    >   DECLARE_FUNCTION                                         'yith_add_google_font'
  60    10    >   INIT_FCALL                                               'function_exists'
        11        SEND_VAL                                                 'yith_google_fonts_url'
        12        DO_ICALL                                         $7      
        13        BOOL_NOT                                         ~8      $7
        14      > JMPZ                                                     ~8, ->16
  64    15    >   DECLARE_FUNCTION                                         'yith_google_fonts_url'
  68    16    > > RETURN                                                   1

Function %00yith_add_google_font%2Fin%2FKSJuf0x7f4177a5767f:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/KSJuf
function name:  yith_add_google_font
number of ops:  8
compiled vars:  !0 = $font, !1 = $variant, !2 = $yith_google_fonts
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  54     0  E >   RECV                                             !0      
         1        RECV_INIT                                        !1      <array>
  55     2        BIND_GLOBAL                                              !2, 'yith_google_fonts'
  56     3        INIT_METHOD_CALL                                         !2, 'add_google_font'
         4        SEND_VAR_EX                                              !0
         5        SEND_VAR_EX                                              !1
         6        DO_FCALL                                      0          
  57     7      > RETURN                                                   null

End of function %00yith_add_google_font%2Fin%2FKSJuf0x7f4177a5767f

Function %00yith_google_fonts_url%2Fin%2FKSJuf0x7f4177a5778c:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/KSJuf
function name:  yith_google_fonts_url
number of ops:  5
compiled vars:  !0 = $yith_google_fonts
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  65     0  E >   BIND_GLOBAL                                              !0, 'yith_google_fonts'
  66     1        INIT_METHOD_CALL                                         !0, 'google_fonts_url'
         2        DO_FCALL                                      0  $1      
         3      > RETURN                                                   $1
  67     4*     > RETURN                                                   null

End of function %00yith_google_fonts_url%2Fin%2FKSJuf0x7f4177a5778c

Class Google_Font:
Function google_fonts_url:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
Jump found. (Code = 77) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
Jump found. (Code = 78) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
Jump found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 21
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/KSJuf
function name:  google_fonts_url
number of ops:  29
compiled vars:  !0 = $base_url, !1 = $fonts, !2 = $variants, !3 = $font
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  19     0  E >   ASSIGN                                                   !0, '%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3D'
  20     1        ASSIGN                                                   !1, <array>
  22     2        ISSET_ISEMPTY_PROP_OBJ                           ~6      'google_fonts'
         3      > JMPZ                                                     ~6, ->5
         4    > > RETURN                                                   null
  24     5    >   FETCH_OBJ_R                                      $7      'google_fonts'
         6      > FE_RESET_R                                       $8      $7, ->21
         7    > > FE_FETCH_R                                       ~9      $8, !2, ->21
         8    >   ASSIGN                                                   !3, ~9
  25     9        INIT_FCALL                                               'urlencode'
        10        CONCAT                                           ~12     !3, '%3A'
        11        INIT_FCALL                                               'implode'
        12        SEND_VAL                                                 '%2C'
        13        SEND_VAR                                                 !2
        14        DO_ICALL                                         $13     
        15        CONCAT                                           ~14     ~12, $13
        16        SEND_VAL                                                 ~14
        17        DO_ICALL                                         $15     
        18        ASSIGN_DIM                                               !1
        19        OP_DATA                                                  $15
        20      > JMP                                                      ->7
        21    >   FE_FREE                                                  $8
  28    22        INIT_FCALL                                               'implode'
        23        SEND_VAL                                                 '%7C'
        24        SEND_VAR                                                 !1
        25        DO_ICALL                                         $16     
        26        CONCAT                                           ~17     !0, $16
        27      > RETURN                                                   ~17
  29    28*     > RETURN                                                   null

End of function google_fonts_url

Function add_google_font:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
Jump found. (Code = 77) Position 1 = 8, Position 2 = 29
Branch analysis from position: 8
Jump found. (Code = 78) Position 1 = 9, Position 2 = 29
Branch analysis from position: 9
Jump found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
Jump found. (Code = 43) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
Jump found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 28
Branch analysis from position: 16
Branch analysis from position: 29
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 7
filename:       /in/KSJuf
function name:  add_google_font
number of ops:  31
compiled vars:  !0 = $font, !1 = $variants, !2 = $variant
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  37     0  E >   RECV                                             !0      
         1        RECV_INIT                                        !1      <array>
  38     2        TYPE_CHECK                                    7  ~3      !1
         3        BOOL_NOT                                         ~4      ~3
         4      > JMPZ                                                     ~4, ->7
         5    >   INIT_ARRAY                                       ~5      !1
         6        ASSIGN                                                   !1, ~5
  40     7    > > FE_RESET_R                                       $7      !1, ->29
         8    > > FE_FETCH_R                                               $7, !2, ->29
  41     9    >   FETCH_OBJ_IS                                     $8      'google_fonts'
        10        ISSET_ISEMPTY_DIM_OBJ                       33554432  ~9      $8, !0
        11        BOOL_NOT                                         ~10     ~9
        12      > JMPZ                                                     ~10, ->16
        13    >   FETCH_OBJ_W                                      $11     'google_fonts'
        14        ASSIGN_DIM                                               $11, !0
        15        OP_DATA                                                  <array>
  42    16    >   INIT_FCALL                                               'in_array'
        17        SEND_VAR                                                 !2
        18        FETCH_OBJ_R                                      $13     'google_fonts'
        19        FETCH_DIM_R                                      $14     $13, !0
        20        SEND_VAR                                                 $14
        21        DO_ICALL                                         $15     
        22        BOOL_NOT                                         ~16     $15
        23      > JMPZ                                                     ~16, ->28
        24    >   FETCH_OBJ_W                                      $17     'google_fonts'
        25        FETCH_DIM_W                                      $18     $17, !0
        26        ASSIGN_DIM                                               $18
        27        OP_DATA                                                  !2
        28    > > JMP                                                      ->8
        29    >   FE_FREE                                                  $7
  44    30      > RETURN                                                   null

End of function add_google_font

End of class Google_Font.

Generated using Vulcan Logic Dumper, using php 7.3.0