3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* NDF, 6 Oct 2014. */ abstract class Hub_Shortcode { const SHORTCODE = 'evidence_hub_shortcode'; public function __construct() { add_shortcode( $this->get_shortcode(), array( &$this, 'shortcode' )); // ... } public function get_shortcode() { $class = get_class( $this ); return property_exists( $this, 'shortcode' ) ? $this->shortcode : static::SHORTCODE; } } class Hub_Shortcode_GeoMap extends Hub_Shortcode { const SHORTCODE = 'geomap'; } $sc = new Evidence_Hub_Shortcode_GeoMap(); var_dump( $sc->get_shortcode() );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWV9B
function name:  (null)
number of ops:  9
compiled vars:  !0 = $sc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $1      'Evidence_Hub_Shortcode_GeoMap'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   32     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'get_shortcode'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class Hub_Shortcode:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWV9B
function name:  __construct
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL_BY_NAME                                       'add_shortcode'
          1        INIT_METHOD_CALL                                         'get_shortcode'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF_EX                                       $0
          4        FETCH_THIS                                       $1      
          5        INIT_ARRAY                                       ~2      $1
          6        ADD_ARRAY_ELEMENT                                ~2      'shortcode'
          7        SEND_VAL_EX                                              ~2
          8        DO_FCALL                                      0          
   15     9      > RETURN                                                   null

End of function __construct

Function get_shortcode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWV9B
function name:  get_shortcode
number of ops:  16
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_THIS                                       ~1      
          1        GET_CLASS                                        ~2      ~1
          2        ASSIGN                                                   !0, ~2
   20     3        INIT_FCALL                                               'property_exists'
          4        FETCH_THIS                                       ~4      
          5        SEND_VAL                                                 ~4
          6        SEND_VAL                                                 'shortcode'
          7        DO_ICALL                                         $5      
          8      > JMPZ                                                     $5, ->12
          9    >   FETCH_OBJ_R                                      ~6      'shortcode'
         10        QM_ASSIGN                                        ~7      ~6
         11      > JMP                                                      ->14
         12    >   FETCH_CLASS_CONSTANT                             ~8      'SHORTCODE'
         13        QM_ASSIGN                                        ~7      ~8
         14    > > RETURN                                                   ~7
   21    15*     > RETURN                                                   null

End of function get_shortcode

End of class Hub_Shortcode.

Class Hub_Shortcode_GeoMap:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWV9B
function name:  __construct
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL_BY_NAME                                       'add_shortcode'
          1        INIT_METHOD_CALL                                         'get_shortcode'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR_NO_REF_EX                                       $0
          4        FETCH_THIS                                       $1      
          5        INIT_ARRAY                                       ~2      $1
          6        ADD_ARRAY_ELEMENT                                ~2      'shortcode'
          7        SEND_VAL_EX                                              ~2
          8        DO_FCALL                                      0          
   15     9      > RETURN                                                   null

End of function __construct

Function get_shortcode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GWV9B
function name:  get_shortcode
number of ops:  16
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_THIS                                       ~1      
          1        GET_CLASS                                        ~2      ~1
          2        ASSIGN                                                   !0, ~2
   20     3        INIT_FCALL                                               'property_exists'
          4        FETCH_THIS                                       ~4      
          5        SEND_VAL                                                 ~4
          6        SEND_VAL                                                 'shortcode'
          7        DO_ICALL                                         $5      
          8      > JMPZ                                                     $5, ->12
          9    >   FETCH_OBJ_R                                      ~6      'shortcode'
         10        QM_ASSIGN                                        ~7      ~6
         11      > JMP                                                      ->14
         12    >   FETCH_CLASS_CONSTANT                             ~8      'SHORTCODE'
         13        QM_ASSIGN                                        ~7      ~8
         14    > > RETURN                                                   ~7
   21    15*     > RETURN                                                   null

End of function get_shortcode

End of class Hub_Shortcode_GeoMap.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.75 ms | 1392 KiB | 17 Q