3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Shit { public static function getShits() { return array( new Shit, new Shit, new Shit ); } public function getTird() { return 'sucks'; } public function getPoopies() { return range(0,10); } } $shits = array(); foreach(Shit::getShits() as $shit) { $shits[] = array( 'tird' => $shit->getTird(), 'fuck' => array_map(function($val) { return $val . ' sucks'; }, $shit->getPoopies()) ); } var_dump($shits);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/KSZnt
function name:  (null)
number of ops:  24
compiled vars:  !0 = $shits, !1 = $shit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_STATIC_METHOD_CALL                                  'Shit', 'getShits'
          2        DO_FCALL                                      0  $3      
          3      > FE_RESET_R                                       $4      $3, ->19
          4    > > FE_FETCH_R                                               $4, !1, ->19
   20     5    >   INIT_METHOD_CALL                                         !1, 'getTird'
          6        DO_FCALL                                      0  $6      
          7        INIT_ARRAY                                       ~7      $6, 'tird'
   21     8        INIT_FCALL                                               'array_map'
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKSZnt%3A21%240'
         10        SEND_VAL                                                 ~8
         11        INIT_METHOD_CALL                                         !1, 'getPoopies'
         12        DO_FCALL                                      0  $9      
         13        SEND_VAR                                                 $9
         14        DO_ICALL                                         $10     
         15        ADD_ARRAY_ELEMENT                                ~7      $10, 'fuck'
   19    16        ASSIGN_DIM                                               !0
   21    17        OP_DATA                                                  ~7
   18    18      > JMP                                                      ->4
         19    >   FE_FREE                                                  $4
   24    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FKSZnt%3A21%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KSZnt
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        CONCAT                                           ~1      !0, '+sucks'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKSZnt%3A21%240

Class Shit:
Function getshits:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KSZnt
function name:  getShits
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $0      'Shit'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~2      $0
    6     3        NEW                                              $3      'Shit'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~2      $3
    7     6        NEW                                              $5      'Shit'
          7        DO_FCALL                                      0          
          8        ADD_ARRAY_ELEMENT                                ~2      $5
          9      > RETURN                                                   ~2
    9    10*     > RETURN                                                   null

End of function getshits

Function gettird:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KSZnt
function name:  getTird
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'sucks'
   12     1*     > RETURN                                                   null

End of function gettird

Function getpoopies:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KSZnt
function name:  getPoopies
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 10
          3        DO_ICALL                                         $0      
          4      > RETURN                                                   $0
   15     5*     > RETURN                                                   null

End of function getpoopies

End of class Shit.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.18 ms | 1400 KiB | 19 Q