3v4l.org

run code in 300+ PHP versions simultaneously
<?php /******************************* * author : hishamdalal@gmail.com * version : 3.1 * date : 2013-04-11 *****************************/ class overloadable { protected $fname = null; protected $fargs = array(); //--------------------------------------------------// function set($obj, $fname, $args){ $n = ''; $type = $this->getType($args); $n = "\$o = new $obj();\n"; $n .= "if(method_exists(\$o, '$fname"."_$type')){\n"; $n .= "\t\$r = \$o->$fname"."_$type(". $this->getArgsName($args) .");\n"; $n .= "}else{\n\t\$r = null;\n"; $n .= "\ttrigger_error('function ".$fname."_".$type." is not exist!');\n}"; eval("\$r = $n;"); return $r; } //--------------------------------------------------// function getType($args) { $argType = array(); foreach($args as $i=>$val) { $argType[$i][] = $this->getSuffix($val, $i) ; } $s = ''; if(is_array($argType)){ foreach($argType as $type){ $s .= implode('', $type); } return $s; } return implode('', $argType); } //--------------------------------------------------// function getSuffix($byValarg, $i) { if( is_numeric($byValarg) ) { $type = 'N'; $this->fargs['N'.$i] = $byValarg; } elseif( is_array($byValarg) ) { $type = 'A'; $this->fargs['A'.$i] = $byValarg; } elseif( is_object($byValarg) ) { $type = 'O'; $this->fargs['O'.$i] = $byValarg; } elseif( is_resource($byValarg) ) { $type = 'R'; $this->fargs['R'.$i] = $byValarg; } else { $type = 'S'; $this->fargs['S'.$i] = $byValarg; } return $type; } //--------------------------------------------------// function getArgsName($args){ $r = array(); $ary = array_keys($this->fargs); foreach( $ary as $k=>$v){ $r[]='$this->fargs["'.$v.'"]'; } return implode(", ", $r); } //--------------------------------------------------// function __call($name, $args){ $this->fargs = array(); return $this->set(get_class($this), $name, $args); } //--------------------------------------------------// } class test2 extends overloadable { function foo_(){ echo 'foo - no args'; } function foo_S($s){ echo "foo - one string $s"; } function foo_SS($s1, $s2){ echo "foo - tow strings $s1, $s2"; } function foo_SN($s, $n){ echo "foo - string and number $s, $n"; } function foo_A($ary){ print_r($ary); } function foo_AA($ary1, $ary2){ if(is_array($ary1) && is_array($ary2)){ echo "foo - tow arrays"; }else{echo 0;} } function foo_O($obj){ echo "foo - "; print_r($obj); } function hi(){ echo "hi - welcome!"; } } echo '<pre>'; $t = new test2(); echo '<br />foo_: '; print_r( $t->foo() ); echo '<br />foo_s: '; print_r( $t->foo('a') ); echo '<br />foo_ss: '; print_r( $t->foo('a', 'b') ); echo '<br />foo_sn: '; print_r( $t->foo('a', 2) ); echo '<br />foo_snn: '; print_r( $t->foo('s', 2, 9) ); echo '<br />foo_a: '; print_r( $t->foo(array(4,5,6,7)) ); echo '<br />foo_aa: '; print_r( $t->foo( array(5,6,7), array(8,9,10) ) ); echo '<br />foo_o: '; print_r( $t->foo($t) ); echo '<br />hi: '; print_r( $t->hi() ); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  (null)
number of ops:  71
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  108     0  E >   ECHO                                                     '%3Cpre%3E'
  109     1        NEW                                              $1      'test2'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
  111     4        ECHO                                                     '%3Cbr+%2F%3Efoo_%3A+'
  112     5        INIT_FCALL                                               'print_r'
          6        INIT_METHOD_CALL                                         !0, 'foo'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
  114    10        ECHO                                                     '%3Cbr+%2F%3Efoo_s%3A+'
  115    11        INIT_FCALL                                               'print_r'
         12        INIT_METHOD_CALL                                         !0, 'foo'
         13        SEND_VAL_EX                                              'a'
         14        DO_FCALL                                      0  $6      
         15        SEND_VAR                                                 $6
         16        DO_ICALL                                                 
  117    17        ECHO                                                     '%3Cbr+%2F%3Efoo_ss%3A+'
  118    18        INIT_FCALL                                               'print_r'
         19        INIT_METHOD_CALL                                         !0, 'foo'
         20        SEND_VAL_EX                                              'a'
         21        SEND_VAL_EX                                              'b'
         22        DO_FCALL                                      0  $8      
         23        SEND_VAR                                                 $8
         24        DO_ICALL                                                 
  120    25        ECHO                                                     '%3Cbr+%2F%3Efoo_sn%3A+'
  121    26        INIT_FCALL                                               'print_r'
         27        INIT_METHOD_CALL                                         !0, 'foo'
         28        SEND_VAL_EX                                              'a'
         29        SEND_VAL_EX                                              2
         30        DO_FCALL                                      0  $10     
         31        SEND_VAR                                                 $10
         32        DO_ICALL                                                 
  123    33        ECHO                                                     '%3Cbr+%2F%3Efoo_snn%3A+'
  124    34        INIT_FCALL                                               'print_r'
         35        INIT_METHOD_CALL                                         !0, 'foo'
         36        SEND_VAL_EX                                              's'
         37        SEND_VAL_EX                                              2
         38        SEND_VAL_EX                                              9
         39        DO_FCALL                                      0  $12     
         40        SEND_VAR                                                 $12
         41        DO_ICALL                                                 
  126    42        ECHO                                                     '%3Cbr+%2F%3Efoo_a%3A+'
  127    43        INIT_FCALL                                               'print_r'
         44        INIT_METHOD_CALL                                         !0, 'foo'
         45        SEND_VAL_EX                                              <array>
         46        DO_FCALL                                      0  $14     
         47        SEND_VAR                                                 $14
         48        DO_ICALL                                                 
  129    49        ECHO                                                     '%3Cbr+%2F%3Efoo_aa%3A+'
  130    50        INIT_FCALL                                               'print_r'
         51        INIT_METHOD_CALL                                         !0, 'foo'
         52        SEND_VAL_EX                                              <array>
         53        SEND_VAL_EX                                              <array>
         54        DO_FCALL                                      0  $16     
         55        SEND_VAR                                                 $16
         56        DO_ICALL                                                 
  132    57        ECHO                                                     '%3Cbr+%2F%3Efoo_o%3A+'
  133    58        INIT_FCALL                                               'print_r'
         59        INIT_METHOD_CALL                                         !0, 'foo'
         60        SEND_VAR_EX                                              !0
         61        DO_FCALL                                      0  $18     
         62        SEND_VAR                                                 $18
         63        DO_ICALL                                                 
  135    64        ECHO                                                     '%3Cbr+%2F%3Ehi%3A+'
  136    65        INIT_FCALL                                               'print_r'
         66        INIT_METHOD_CALL                                         !0, 'hi'
         67        DO_FCALL                                      0  $20     
         68        SEND_VAR                                                 $20
         69        DO_ICALL                                                 
  137    70      > RETURN                                                   1

Class overloadable:
Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  set
number of ops:  43
compiled vars:  !0 = $obj, !1 = $fname, !2 = $args, !3 = $n, !4 = $type, !5 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   15     3        ASSIGN                                                   !3, ''
   16     4        INIT_METHOD_CALL                                         'getType'
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !4, $7
   17     8        ROPE_INIT                                     3  ~10     '%24o+%3D+new+'
          9        ROPE_ADD                                      1  ~10     ~10, !0
         10        ROPE_END                                      2  ~9      ~10, '%28%29%3B%0A'
         11        ASSIGN                                                   !3, ~9
   18    12        NOP                                                      
         13        FAST_CONCAT                                      ~13     'if%28method_exists%28%24o%2C+%27', !1
         14        ROPE_INIT                                     3  ~15     '_'
         15        ROPE_ADD                                      1  ~15     ~15, !4
         16        ROPE_END                                      2  ~14     ~15, '%27%29%29%7B%0A'
         17        CONCAT                                           ~17     ~13, ~14
         18        ASSIGN_OP                                     8          !3, ~17
   19    19        NOP                                                      
         20        FAST_CONCAT                                      ~19     '%09%24r+%3D+%24o-%3E', !1
         21        ROPE_INIT                                     3  ~21     '_'
         22        ROPE_ADD                                      1  ~21     ~21, !4
         23        ROPE_END                                      2  ~20     ~21, '%28'
         24        CONCAT                                           ~23     ~19, ~20
         25        INIT_METHOD_CALL                                         'getArgsName'
         26        SEND_VAR_EX                                              !2
         27        DO_FCALL                                      0  $24     
         28        CONCAT                                           ~25     ~23, $24
         29        CONCAT                                           ~26     ~25, '%29%3B%0A'
         30        ASSIGN_OP                                     8          !3, ~26
   20    31        ASSIGN_OP                                     8          !3, '%7Delse%7B%0A%09%24r+%3D+null%3B%0A'
   21    32        CONCAT                                           ~29     '%09trigger_error%28%27function+', !1
         33        CONCAT                                           ~30     ~29, '_'
         34        CONCAT                                           ~31     ~30, !4
         35        CONCAT                                           ~32     ~31, '+is+not+exist%21%27%29%3B%0A%7D'
         36        ASSIGN_OP                                     8          !3, ~32
   22    37        ROPE_INIT                                     3  ~35     '%24r+%3D+'
         38        ROPE_ADD                                      1  ~35     ~35, !3
         39        ROPE_END                                      2  ~34     ~35, '%3B'
         40        INCLUDE_OR_EVAL                                          ~34, EVAL
   23    41      > RETURN                                                   !5
   24    42*     > RETURN                                                   null

End of function set

Function gettype:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/hb5JL
function name:  getType
number of ops:  33
compiled vars:  !0 = $args, !1 = $argType, !2 = $val, !3 = $i, !4 = $s, !5 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        ASSIGN                                                   !1, <array>
   28     2      > FE_RESET_R                                       $7      !0, ->13
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->13
          4    >   ASSIGN                                                   !3, ~8
   29     5        INIT_METHOD_CALL                                         'getSuffix'
          6        SEND_VAR_EX                                              !2
          7        SEND_VAR_EX                                              !3
          8        DO_FCALL                                      0  $12     
          9        FETCH_DIM_W                                      $10     !1, !3
         10        ASSIGN_DIM                                               $10
         11        OP_DATA                                                  $12
   28    12      > JMP                                                      ->3
         13    >   FE_FREE                                                  $7
   31    14        ASSIGN                                                   !4, ''
   32    15        TYPE_CHECK                                  128          !1
         16      > JMPZ                                                     ~14, ->27
   33    17    > > FE_RESET_R                                       $15     !1, ->25
         18    > > FE_FETCH_R                                               $15, !5, ->25
   34    19    >   INIT_FCALL                                               'implode'
         20        SEND_VAL                                                 ''
         21        SEND_VAR                                                 !5
         22        DO_ICALL                                         $16     
         23        ASSIGN_OP                                     8          !4, $16
   33    24      > JMP                                                      ->18
         25    >   FE_FREE                                                  $15
   36    26      > RETURN                                                   !4
   38    27    >   INIT_FCALL                                               'implode'
         28        SEND_VAL                                                 ''
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                         $18     
         31      > RETURN                                                   $18
   39    32*     > RETURN                                                   null

End of function gettype

Function getsuffix:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 36
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  getSuffix
number of ops:  43
compiled vars:  !0 = $byValarg, !1 = $i, !2 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   42     2        INIT_FCALL                                               'is_numeric'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5      > JMPZ                                                     $3, ->12
   43     6    >   ASSIGN                                                   !2, 'N'
   44     7        CONCAT                                           ~6      'N', !1
          8        FETCH_OBJ_W                                      $5      'fargs'
          9        ASSIGN_DIM                                               $5, ~6
         10        OP_DATA                                                  !0
         11      > JMP                                                      ->41
   45    12    >   TYPE_CHECK                                  128          !0
         13      > JMPZ                                                     ~8, ->20
   46    14    >   ASSIGN                                                   !2, 'A'
   47    15        CONCAT                                           ~11     'A', !1
         16        FETCH_OBJ_W                                      $10     'fargs'
         17        ASSIGN_DIM                                               $10, ~11
         18        OP_DATA                                                  !0
         19      > JMP                                                      ->41
   48    20    >   TYPE_CHECK                                  256          !0
         21      > JMPZ                                                     ~13, ->28
   49    22    >   ASSIGN                                                   !2, 'O'
   50    23        CONCAT                                           ~16     'O', !1
         24        FETCH_OBJ_W                                      $15     'fargs'
         25        ASSIGN_DIM                                               $15, ~16
         26        OP_DATA                                                  !0
         27      > JMP                                                      ->41
   51    28    >   TYPE_CHECK                                  512          !0
         29      > JMPZ                                                     ~18, ->36
   52    30    >   ASSIGN                                                   !2, 'R'
   53    31        CONCAT                                           ~21     'R', !1
         32        FETCH_OBJ_W                                      $20     'fargs'
         33        ASSIGN_DIM                                               $20, ~21
         34        OP_DATA                                                  !0
         35      > JMP                                                      ->41
   55    36    >   ASSIGN                                                   !2, 'S'
   56    37        CONCAT                                           ~25     'S', !1
         38        FETCH_OBJ_W                                      $24     'fargs'
         39        ASSIGN_DIM                                               $24, ~25
         40        OP_DATA                                                  !0
   58    41    > > RETURN                                                   !2
   59    42*     > RETURN                                                   null

End of function getsuffix

Function getargsname:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/hb5JL
function name:  getArgsName
number of ops:  22
compiled vars:  !0 = $args, !1 = $r, !2 = $ary, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   RECV                                             !0      
   62     1        ASSIGN                                                   !1, <array>
   63     2        INIT_FCALL                                               'array_keys'
          3        FETCH_OBJ_R                                      ~6      'fargs'
          4        SEND_VAL                                                 ~6
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   64     7      > FE_RESET_R                                       $9      !2, ->15
          8    > > FE_FETCH_R                                       ~10     $9, !3, ->15
          9    >   ASSIGN                                                   !4, ~10
   65    10        CONCAT                                           ~13     '%24this-%3Efargs%5B%22', !3
         11        CONCAT                                           ~14     ~13, '%22%5D'
         12        ASSIGN_DIM                                               !1
         13        OP_DATA                                                  ~14
   64    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $9
   67    16        INIT_FCALL                                               'implode'
         17        SEND_VAL                                                 '%2C+'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $15     
         20      > RETURN                                                   $15
   68    21*     > RETURN                                                   null

End of function getargsname

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  __call
number of ops:  13
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   70     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   71     2        ASSIGN_OBJ                                               'fargs'
          3        OP_DATA                                                  <array>
   72     4        INIT_METHOD_CALL                                         'set'
          5        FETCH_THIS                                       ~3      
          6        GET_CLASS                                        ~4      ~3
          7        SEND_VAL_EX                                              ~4
          8        SEND_VAR_EX                                              !0
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $5      
         11      > RETURN                                                   $5
   73    12*     > RETURN                                                   null

End of function __call

End of class overloadable.

Class test2:
Function foo_:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  foo_
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   80     0  E >   ECHO                                                     'foo+-+no+args'
   81     1      > RETURN                                                   null

End of function foo_

Function foo_s:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  foo_S
number of ops:  5
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   82     0  E >   RECV                                             !0      
   83     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      'foo+-+one+string+', !0
          3        ECHO                                                     ~1
   84     4      > RETURN                                                   null

End of function foo_s

Function foo_ss:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  foo_SS
number of ops:  8
compiled vars:  !0 = $s1, !1 = $s2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   85     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   86     2        ROPE_INIT                                     4  ~3      'foo+-+tow+strings+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '%2C+'
          5        ROPE_END                                      3  ~2      ~3, !1
          6        ECHO                                                     ~2
   87     7      > RETURN                                                   null

End of function foo_ss

Function foo_sn:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  foo_SN
number of ops:  8
compiled vars:  !0 = $s, !1 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   88     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   89     2        ROPE_INIT                                     4  ~3      'foo+-+string+and+number+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '%2C+'
          5        ROPE_END                                      3  ~2      ~3, !1
          6        ECHO                                                     ~2
   90     7      > RETURN                                                   null

End of function foo_sn

Function foo_a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  foo_A
number of ops:  5
compiled vars:  !0 = $ary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   91     0  E >   RECV                                             !0      
   92     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   93     4      > RETURN                                                   null

End of function foo_a

Function foo_aa:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/hb5JL
function name:  foo_AA
number of ops:  11
compiled vars:  !0 = $ary1, !1 = $ary2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   94     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   95     2        TYPE_CHECK                                  128  ~2      !0
          3      > JMPZ_EX                                          ~2      ~2, ->6
          4    >   TYPE_CHECK                                  128  ~3      !1
          5        BOOL                                             ~2      ~3
          6    > > JMPZ                                                     ~2, ->9
   96     7    >   ECHO                                                     'foo+-+tow+arrays'
          8      > JMP                                                      ->10
   97     9    >   ECHO                                                     0
   98    10    > > RETURN                                                   null

End of function foo_aa

Function foo_o:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  foo_O
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   99     0  E >   RECV                                             !0      
  100     1        ECHO                                                     'foo+-+'
  101     2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
  102     5      > RETURN                                                   null

End of function foo_o

Function hi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  hi
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  104     0  E >   ECHO                                                     'hi+-+welcome%21'
  105     1      > RETURN                                                   null

End of function hi

Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hb5JL
function name:  set
number of ops:  43
compiled vars:  !0 = $obj, !1 = $fname, !2 = $args, !3 = $n, !4 = $type, !5 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   15     3        ASSIGN                                                   !3, ''
   16     4        INIT_METHOD_CALL                                         'getType'
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !4, $7
   17     8        ROPE_INIT                                     3  ~10     '%24o+%3D+new+'
          9        ROPE_ADD                                      1  ~10     ~10, !0
         10        ROPE_END                                      2  ~9      ~10, '%28%29%3B%0A'
         11        ASSIGN                                                   !3, ~9
   18    12        NOP                                                      
         13        FAST_CONCAT                                      ~13     'if%28method_exists%28%24o%2C+%27', !1
         14        ROPE_INIT                                     3  ~15     '_'
         15        ROPE_ADD                                      1  ~15     ~15, !4
         16        ROPE_END                                      2  ~14     ~15, '%27%29%29%7B%0A'
         17        CONCAT                     

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
266.41 ms | 973 KiB | 23 Q