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); } $out = "<br />"; } return $this->store = $out; } /* PRIVATE, SO NOT ACCESSIBLE! */ 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 testCase(); //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))); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GtKVj
function name:  (null)
number of ops:  15
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $1      'testCase'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   37     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        DO_ICALL                                         $5      
         11        SEND_VAR_NO_REF_EX                                       $5
         12        DO_FCALL                                      0  $6      
         13        ECHO                                                     $6
   39    14      > RETURN                                                   1

Class testCase:
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/GtKVj
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
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      <array>
          1        RECV                                             !1      
    7     2      > FE_RESET_R                                       $4      !0, ->16
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->16
          4    >   ASSIGN                                                   !3, ~5
    8     5        MOD                                              ~7      !3, 2
          6        IS_EQUAL                                                 ~7, 0
          7      > JMPZ                                                     ~8, ->10
    9     8    >   ASSIGN                                                   !1, !2
          9      > JMP                                                      ->14
   11    10    >   INIT_FCALL                                               'strtoupper'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !1, $10
   13    14    >   ASSIGN                                                   !1, '%3Cbr+%2F%3E'
    7    15      > JMP                                                      ->3
         16    >   FE_FREE                                                  $4
   15    17        ASSIGN_OBJ                                       ~13     'store'
         18        OP_DATA                                                  !1
         19      > RETURN                                                   ~13
   16    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/GtKVj
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
-------------------------------------------------------------------------------------
   19     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      <array>
   20     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
   21     8      > FE_RESET_R                                       $6      !0, ->23
          9    > > FE_FETCH_R                                       ~7      $6, !2, ->23
         10    >   ASSIGN                                                   !3, ~7
   22    11        MOD                                              ~9      !3, 2
         12        IS_NOT_EQUAL                                             ~9, 0
         13      > JMPZ                                                     ~10, ->17
   23    14    >   ASSIGN_DIM                                               !1, !3
         15        OP_DATA                                                  !2
         16      > JMP                                                      ->22
   25    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
   21    22    > > JMP                                                      ->9
         23    >   FE_FREE                                                  $6
   28    24        ECHO                                                     !1
   29    25      > RETURN                                                   null

End of function unfunction

End of class testCase.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.06 ms | 1392 KiB | 21 Q