3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function test($tableau) { var_dump($tableau); return true; } } class B extends A{ public function test($tableau) { $limit = 5; $res = true; $size = count($tableau); if( $size > $limit ) { for ($i=0; $i < round($size/$limit) ; $i++) { echo ($i*$limit); $res &= parent::test(array_splice($tableau,($i*$limit),$limit)); } } return $res; } } $ar = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o'); echo count($ar)."\n----------\n"; $b = new B(); B->test($ar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1MrhS
function name:  (null)
number of ops:  12
compiled vars:  !0 = $ar, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   ASSIGN                                                   !0, <array>
   28     1        COUNT                                            ~3      !0
          2        CONCAT                                           ~4      ~3, '%0A----------%0A'
          3        ECHO                                                     ~4
   29     4        NEW                                              $5      'B'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   30     7        FETCH_CONSTANT                                   ~8      'B'
          8        INIT_METHOD_CALL                                         ~8, 'test'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1MrhS
function name:  test
number of ops:  6
compiled vars:  !0 = $tableau
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    6     4      > RETURN                                                   <true>
    7     5*     > RETURN                                                   null

End of function test

End of class A.

Class B:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 28
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 9
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 9
Branch analysis from position: 28
Branch analysis from position: 9
Branch analysis from position: 28
filename:       /in/1MrhS
function name:  test
number of ops:  30
compiled vars:  !0 = $tableau, !1 = $limit, !2 = $res, !3 = $size, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        ASSIGN                                                   !1, 5
   14     2        ASSIGN                                                   !2, <true>
   15     3        COUNT                                            ~7      !0
          4        ASSIGN                                                   !3, ~7
   16     5        IS_SMALLER                                               !1, !3
          6      > JMPZ                                                     ~9, ->28
   18     7    >   ASSIGN                                                   !4, 0
          8      > JMP                                                      ->22
   19     9    >   MUL                                              ~11     !4, !1
         10        ECHO                                                     ~11
   20    11        INIT_STATIC_METHOD_CALL                                  'test'
         12        INIT_FCALL                                               'array_splice'
         13        SEND_REF                                                 !0
         14        MUL                                              ~12     !4, !1
         15        SEND_VAL                                                 ~12
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $13     
         18        SEND_VAR_NO_REF_EX                                       $13
         19        DO_FCALL                                      0  $14     
         20        ASSIGN_OP                                    10          !2, $14
   18    21        PRE_INC                                                  !4
         22    >   INIT_FCALL                                               'round'
         23        DIV                                              ~17     !3, !1
         24        SEND_VAL                                                 ~17
         25        DO_ICALL                                         $18     
         26        IS_SMALLER                                               !4, $18
         27      > JMPNZ                                                    ~19, ->9
   23    28    > > RETURN                                                   !2
   24    29*     > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.31 ms | 1400 KiB | 19 Q