3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MultiImageComponent { public $imgs = []; public function __construct() { foreach(func_get_args() as $url) { $this->imgs[] = new Image($url); } } public function getUrls() { $urls = []; foreach($this->imgs as $img) { $urls[] = $img->getUrl(); } return $urls; } } class Image { private $url = ''; public function __construct($url) { $this->url = $url; } public function getUrl() { return $this->url; } } $mic = new MultiImageComponent("https://photos.smugmug.com/Comics/Pa-comics/n-xmQS5/i-RZcDzzK/0/2100x20000/i-RZcDzzK-2100x20000.jpg", "http://www.acq-inc.com/assets/ai/img/img_staff.gif", "https://a.fsdn.com/sd/topics/business_64.png"); var_dump($mic->getUrls());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8otjI
function name:  (null)
number of ops:  12
compiled vars:  !0 = $mic
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $1      'MultiImageComponent'
          1        SEND_VAL_EX                                              'https%3A%2F%2Fphotos.smugmug.com%2FComics%2FPa-comics%2Fn-xmQS5%2Fi-RZcDzzK%2F0%2F2100x20000%2Fi-RZcDzzK-2100x20000.jpg'
          2        SEND_VAL_EX                                              'http%3A%2F%2Fwww.acq-inc.com%2Fassets%2Fai%2Fimg%2Fimg_staff.gif'
          3        SEND_VAL_EX                                              'https%3A%2F%2Fa.fsdn.com%2Fsd%2Ftopics%2Fbusiness_64.png'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   35     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'getUrls'
          8        DO_FCALL                                      0  $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class MultiImageComponent:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/8otjI
function name:  __construct
number of ops:  12
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FUNC_GET_ARGS                                    ~1      
          1      > FE_RESET_R                                       $2      ~1, ->10
          2    > > FE_FETCH_R                                               $2, !0, ->10
    7     3    >   NEW                                              $5      'Image'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        FETCH_OBJ_W                                      $3      'imgs'
          7        ASSIGN_DIM                                               $3
          8        OP_DATA                                                  $5
    6     9      > JMP                                                      ->2
         10    >   FE_FREE                                                  $2
    9    11      > RETURN                                                   null

End of function __construct

Function geturls:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/8otjI
function name:  getUrls
number of ops:  12
compiled vars:  !0 = $urls, !1 = $img
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        FETCH_OBJ_R                                      ~3      'imgs'
          2      > FE_RESET_R                                       $4      ~3, ->9
          3    > > FE_FETCH_R                                               $4, !1, ->9
   14     4    >   INIT_METHOD_CALL                                         !1, 'getUrl'
          5        DO_FCALL                                      0  $6      
          6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  $6
   13     8      > JMP                                                      ->3
          9    >   FE_FREE                                                  $4
   17    10      > RETURN                                                   !0
   18    11*     > RETURN                                                   null

End of function geturls

End of class MultiImageComponent.

Class Image:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8otjI
function name:  __construct
number of ops:  4
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        ASSIGN_OBJ                                               'url'
          2        OP_DATA                                                  !0
   26     3      > RETURN                                                   null

End of function __construct

Function geturl:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8otjI
function name:  getUrl
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   FETCH_OBJ_R                                      ~0      'url'
          1      > RETURN                                                   ~0
   30     2*     > RETURN                                                   null

End of function geturl

End of class Image.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.79 ms | 1400 KiB | 15 Q