3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testCase { private $stores; /* $out not having default value so type not inferred */ /* names very vague */ public function doFunction($items = array(), $out ) { foreach($items as $num => $val) { /* lots of overriding of output here, seems like += or concat */ if($num%2 == 0) { $out = $val; } else { $out = strtoupper($val); } /* WHY DO ALL OF THE ABOVE IF WE'RE GOING TO OVERRIDE IT WITH THIS ANYWAY? */ //$out = "<br />"; } return $this->store = $out; } /* PRIVATE, SO NOT ACCESSIBLE! FIX: make public */ /* name is vague */ private function unFunction($items = '', $out = array()) { $items = implode("<br >", $items, -1); foreach($items as $num => $val) { if($num%2 != 0) { $out[$num] = $val; } else { $out[$num] = strtlower($val); } } echo $out; } } class testCase1 { public $stores; public function doFunction($items = array(), $out = '') { foreach($items as $num => $val) { if($num % 2 === 0) { $out .= $val; } else { $out .= strtoupper($val); } $out .= "<br />"; } return $this->store = $out; } public function unFunction($items = '', $out = array()) { $items = implode("<br />", $items); foreach($items as $num => $val) { if($num % 2 !== 0) { $out[$num] = $val; } else { $out[$num] = strtlower($val); } } echo $out; } } $test = new testCase1(); $test->doFunction(array_merge(range(0,25), range('a','z'))) . "<hr />"; echo $test->stores; //print_r($test -> unFunction($test->stores)); //echo $test->doFunction(array_merge(range(0,25)), "test"); /* seems like the two functions are about: doing something and undoing that. */ ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VTB33
function name:  (null)
number of ops:  23
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   68     0  E >   NEW                                              $1      'testCase1'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   70     3        INIT_METHOD_CALL                                         !0, 'doFunction'
          4        INIT_FCALL                                               'array_merge'
          5        INIT_FCALL                                               'range'
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 25
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        INIT_FCALL                                               'range'
         11        SEND_VAL                                                 'a'
         12        SEND_VAL                                                 'z'
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                         $6      
         16        SEND_VAR_NO_REF_EX                                       $6
         17        DO_FCALL                                      0  $7      
         18        CONCAT                                           ~8      $7, '%3Chr+%2F%3E'
         19        FREE                                                     ~8
   71    20        FETCH_OBJ_R                                      ~9      !0, 'stores'
         21        ECHO                                                     ~9
   80    22      > RETURN                                                   1

Class testCase:
Function dofunction:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/VTB33
function name:  doFunction
number of ops:  20
compiled vars:  !0 = $items, !1 = $out, !2 = $val, !3 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV_INIT                                        !0      <array>
          1        RECV                                             !1      
   10     2      > FE_RESET_R                                       $4      !0, ->15
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->15
          4    >   ASSIGN                                                   !3, ~5
   12     5        MOD                                              ~7      !3, 2
          6        IS_EQUAL                                                 ~7, 0
          7      > JMPZ                                                     ~8, ->10
   13     8    >   ASSIGN                                                   !1, !2
          9      > JMP                                                      ->14
   15    10    >   INIT_FCALL                                               'strtoupper'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !1, $10
   10    14    > > JMP                                                      ->3
         15    >   FE_FREE                                                  $4
   20    16        ASSIGN_OBJ                                       ~12     'store'
         17        OP_DATA                                                  !1
         18      > RETURN                                                   ~12
   21    19*     > RETURN                                                   null

End of function dofunction

Function unfunction:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 23
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/VTB33
function name:  unFunction
number of ops:  26
compiled vars:  !0 = $items, !1 = $out, !2 = $val, !3 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      <array>
   26     2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%3Cbr+%3E'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 -1
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !0, $4
   27     8      > FE_RESET_R                                       $6      !0, ->23
          9    > > FE_FETCH_R                                       ~7      $6, !2, ->23
         10    >   ASSIGN                                                   !3, ~7
   28    11        MOD                                              ~9      !3, 2
         12        IS_NOT_EQUAL                                             ~9, 0
         13      > JMPZ                                                     ~10, ->17
   29    14    >   ASSIGN_DIM                                               !1, !3
         15        OP_DATA                                                  !2
         16      > JMP                                                      ->22
   31    17    >   INIT_FCALL_BY_NAME                                       'strtlower'
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0  $13     
         20        ASSIGN_DIM                                               !1, !3
         21        OP_DATA                                                  $13
   27    22    > > JMP                                                      ->9
         23    >   FE_FREE                                                  $6
   34    24        ECHO                                                     !1
   35    25      > RETURN                                                   null

End of function unfunction

End of class testCase.

Class testCase1:
Function dofunction:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/VTB33
function name:  doFunction
number of ops:  21
compiled vars:  !0 = $items, !1 = $out, !2 = $val, !3 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   RECV_INIT                                        !0      <array>
          1        RECV_INIT                                        !1      ''
   43     2      > FE_RESET_R                                       $4      !0, ->16
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->16
          4    >   ASSIGN                                                   !3, ~5
   44     5        MOD                                              ~7      !3, 2
          6        IS_IDENTICAL                                             ~7, 0
          7      > JMPZ                                                     ~8, ->10
   45     8    >   ASSIGN_OP                                     8          !1, !2
          9      > JMP                                                      ->14
   47    10    >   INIT_FCALL                                               'strtoupper'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $10     
         13        ASSIGN_OP                                     8          !1, $10
   49    14    >   ASSIGN_OP                                     8          !1, '%3Cbr+%2F%3E'
   43    15      > JMP                                                      ->3
         16    >   FE_FREE                                                  $4
   52    17        ASSIGN_OBJ                                       ~13     'store'
         18        OP_DATA                                                  !1
         19      > RETURN                                                   ~13
   53    20*     > RETURN                                                   null

End of function dofunction

Function unfunction:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/VTB33
function name:  unFunction
number of ops:  25
compiled vars:  !0 = $items, !1 = $out, !2 = $val, !3 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      <array>
   56     2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%3Cbr+%2F%3E'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !0, $4
   57     7      > FE_RESET_R                                       $6      !0, ->22
          8    > > FE_FETCH_R                                       ~7      $6, !2, ->22
          9    >   ASSIGN                                                   !3, ~7
   58    10        MOD                                              ~9      !3, 2
         11        IS_NOT_IDENTICAL                                         ~9, 0
         12      > JMPZ                                                     ~10, ->16
   59    13    >   ASSIGN_DIM                                               !1, !3
         14        OP_DATA                                                  !2
         15      > JMP                                                      ->21
   61    16    >   INIT_FCALL_BY_NAME                                       'strtlower'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $13     
         19        ASSIGN_DIM                                               !1, !3
         20        OP_DATA                                                  $13
   57    21    > > JMP                                                      ->8
         22    >   FE_FREE                                                  $6
   64    23        ECHO                                                     !1
   65    24      > RETURN                                                   null

End of function unfunction

End of class testCase1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.06 ms | 1408 KiB | 21 Q