3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a{ public function b(){ echo 'toto'; } } $a = new a(); $method = 'b'; var_dump(is_callable(array($a,$method))); $a->$method(); function uc_words($str, $destSep='_', $srcSep='_') { return str_replace(' ', $destSep, ucwords(str_replace($srcSep, ' ', $str))); } $attr = 'mon_code_attribut'; echo uc_words($attr,'');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u0kTH
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $method, !2 = $attr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $3      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   10     3        ASSIGN                                                   !1, 'b'
   12     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'is_callable'
          6        INIT_ARRAY                                       ~7      !0
          7        ADD_ARRAY_ELEMENT                                ~7      !1
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                                 
   14    12        INIT_METHOD_CALL                                         !0, !1
         13        DO_FCALL                                      0          
   22    14        ASSIGN                                                   !2, 'mon_code_attribut'
   24    15        INIT_FCALL                                               'uc_words'
         16        SEND_VAR                                                 !2
         17        SEND_VAL                                                 ''
         18        DO_FCALL                                      0  $12     
         19        ECHO                                                     $12
         20      > RETURN                                                   1

Function uc_words:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u0kTH
function name:  uc_words
number of ops:  18
compiled vars:  !0 = $str, !1 = $destSep, !2 = $srcSep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      '_'
          2        RECV_INIT                                        !2      '_'
   18     3        INIT_FCALL                                               'str_replace'
          4        SEND_VAL                                                 '+'
          5        SEND_VAR                                                 !1
          6        INIT_FCALL                                               'ucwords'
          7        INIT_FCALL                                               'str_replace'
          8        SEND_VAR                                                 !2
          9        SEND_VAL                                                 '+'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                         $4      
         14        SEND_VAR                                                 $4
         15        DO_ICALL                                         $5      
         16      > RETURN                                                   $5
   19    17*     > RETURN                                                   null

End of function uc_words

Class a:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u0kTH
function name:  b
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'toto'
    6     1      > RETURN                                                   null

End of function b

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.05 ms | 1403 KiB | 22 Q