3v4l.org

run code in 300+ PHP versions simultaneously
<?php class mcl { public function special_functions($occurances) { $replace_html = ''; if($occurances) { switch ($occurances[1]) { case 'text and text': $replace_html = 'NOTEPAD'; break; case 'code and code': $replace_html = 'PHP'; break; default: $replace_html =''; break; } } return $replace_html; } public function dosomething() { $data = 'you will have a {{text and text}} in such a format to do {{code and code}}'; $data = preg_replace_callback('/{{([^{}]*)}}/', array($this, 'special_functions'), $data); return $data; } } $o = new mcl(); echo $o->dosomething();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RAvt1
function name:  (null)
number of ops:  7
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $1      'mcl'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   32     3        INIT_METHOD_CALL                                         !0, 'dosomething'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Class mcl:
Function special_functions:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
4 jumps found. (Code = 188) Position 1 = 10, Position 2 = 12, Position 3 = 14, Position 4 = 5
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 12
Branch analysis from position: 10
Branch analysis from position: 17
filename:       /in/RAvt1
function name:  special_functions
number of ops:  19
compiled vars:  !0 = $occurances, !1 = $replace_html
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, ''
    7     2      > JMPZ                                                     !0, ->17
    8     3    >   FETCH_DIM_R                                      ~3      !0, 1
          4      > SWITCH_STRING                                            ~3, [ 'text+and+text':->10, 'code+and+code':->12, ], ->14
    9     5    >   CASE                                                     ~3, 'text+and+text'
          6      > JMPNZ                                                    ~4, ->10
   12     7    >   CASE                                                     ~3, 'code+and+code'
          8      > JMPNZ                                                    ~4, ->12
          9    > > JMP                                                      ->14
   10    10    >   ASSIGN                                                   !1, 'NOTEPAD'
   11    11      > JMP                                                      ->16
   13    12    >   ASSIGN                                                   !1, 'PHP'
   14    13      > JMP                                                      ->16
   17    14    >   ASSIGN                                                   !1, ''
   18    15      > JMP                                                      ->16
         16    >   FREE                                                     ~3
   21    17    > > RETURN                                                   !1
   22    18*     > RETURN                                                   null

End of function special_functions

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RAvt1
function name:  dosomething
number of ops:  12
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ASSIGN                                                   !0, 'you+will+have+a+%7B%7Btext+and+text%7D%7D+in+such+a+format+to+do+%7B%7Bcode+and+code%7D%7D'
   26     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%7B%7B%28%5B%5E%7B%7D%5D%2A%29%7D%7D%2F'
          3        FETCH_THIS                                       ~2      
          4        INIT_ARRAY                                       ~3      ~2
          5        ADD_ARRAY_ELEMENT                                ~3      'special_functions'
          6        SEND_VAL                                                 ~3
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !0, $4
   27    10      > RETURN                                                   !0
   28    11*     > RETURN                                                   null

End of function dosomething

End of class mcl.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.92 ms | 1007 KiB | 14 Q