3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testCase { private $stores; public function doFunction($items = array(), $out ) { foreach($items as $num => $val) { 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? */ //$out = "<br />"; } return $this->store = $out; } /* PRIVATE, SO NOT ACCESSIBLE! FIX: make public */ 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 { private $stores; public function doFunction($items, $out ) { foreach($items as $num => $val) { if($num % 2 === 0) { $out += $val; } else { $out += strtoupper($val); } $out += "<br />"; } return $this->store = $out; } 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; } } $test = new testCase1(); echo $test -> doFunction(array_merge(range(0,25), range('a','z'))) . "<hr />"; //print_r($test -> unFunction($test->store)); //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/1jfCn
function name:  (null)
number of ops:  21
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   NEW                                              $1      'testCase1'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   65     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        ECHO                                                     ~8
   74    20      > 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/1jfCn
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
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      <array>
          1        RECV                                             !1      
    8     2      > FE_RESET_R                                       $4      !0, ->15
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->15
          4    >   ASSIGN                                                   !3, ~5
    9     5        MOD                                              ~7      !3, 2
          6        IS_EQUAL                                                 ~7, 0
          7      > JMPZ                                                     ~8, ->10
   10     8    >   ASSIGN                                                   !1, !2
          9      > JMP                                                      ->14
   12    10    >   INIT_FCALL                                               'strtoupper'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !1, $10
    8    14    > > JMP                                                      ->3
         15    >   FE_FREE                                                  $4
   17    16        ASSIGN_OBJ                                       ~12     'store'
         17        OP_DATA                                                  !1
         18      > RETURN                                                   ~12
   18    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/1jfCn
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
-------------------------------------------------------------------------------------
   21     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      <array>
   22     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
   23     8      > FE_RESET_R                                       $6      !0, ->23
          9    > > FE_FETCH_R                                       ~7      $6, !2, ->23
         10    >   ASSIGN                                                   !3, ~7
   24    11        MOD                                              ~9      !3, 2
         12        IS_NOT_EQUAL                                             ~9, 0
         13      > JMPZ                                                     ~10, ->17
   25    14    >   ASSIGN_DIM                                               !1, !3
         15        OP_DATA                                                  !2
         16      > JMP                                                      ->22
   27    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
   23    22    > > JMP                                                      ->9
         23    >   FE_FREE                                                  $6
   30    24        ECHO                                                     !1
   31    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/1jfCn
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
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   39     2      > FE_RESET_R                                       $4      !0, ->16
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->16
          4    >   ASSIGN                                                   !3, ~5
   40     5        MOD                                              ~7      !3, 2
          6        IS_IDENTICAL                                             ~7, 0
          7      > JMPZ                                                     ~8, ->10
   41     8    >   ASSIGN_OP                                     1          !1, !2
          9      > JMP                                                      ->14
   43    10    >   INIT_FCALL                                               'strtoupper'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $10     
         13        ASSIGN_OP                                     1          !1, $10
   45    14    >   ASSIGN_OP                                     1          !1, '%3Cbr+%2F%3E'
   39    15      > JMP                                                      ->3
         16    >   FE_FREE                                                  $4
   47    17        ASSIGN_OBJ                                       ~13     'store'
         18        OP_DATA                                                  !1
         19      > RETURN                                                   ~13
   48    20*     > 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/1jfCn
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
-------------------------------------------------------------------------------------
   50     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      <array>
   51     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
   52     8      > FE_RESET_R                                       $6      !0, ->23
          9    > > FE_FETCH_R                                       ~7      $6, !2, ->23
         10    >   ASSIGN                                                   !3, ~7
   53    11        MOD                                              ~9      !3, 2
         12        IS_NOT_EQUAL                                             ~9, 0
         13      > JMPZ                                                     ~10, ->17
   54    14    >   ASSIGN_DIM                                               !1, !3
         15        OP_DATA                                                  !2
         16      > JMP                                                      ->22
   56    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
   52    22    > > JMP                                                      ->9
         23    >   FE_FREE                                                  $6
   59    24        ECHO                                                     !1
   60    25      > RETURN                                                   null

End of function unfunction

End of class testCase1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.88 ms | 1408 KiB | 21 Q