3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class MyFile { private $filename; private $mimeType; public function __construct($filename, $mimeType) { $this->filename = $filename; $this->mimeType = $mimeType; } public function getFilename() { return $this->filename; } public function getMimeType() { return $this->mimeType; } public function __toString() { return $this->filename; } } $array1[] = new MyFile("peter.jpg", "image/jpg"); $array1[] = new MyFile("peter.jpg", "image/png"); $array1[] = new MyFile("michal.jpg", "image/jpg"); $array2[] = new MyFile("johan.jpg", "image/jpg"); $array2[] = new MyFile("peter.jpg", "image/jpg"); $diffArray = array_diff($array1, $array2); var_dump($diffArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RRXWc
function name:  (null)
number of ops:  40
compiled vars:  !0 = $array1, !1 = $array2, !2 = $diffArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'myfile'
   27     1        NEW                                              $4      'MyFile'
          2        SEND_VAL_EX                                              'peter.jpg'
          3        SEND_VAL_EX                                              'image%2Fjpg'
          4        DO_FCALL                                      0          
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  $4
   28     7        NEW                                              $7      'MyFile'
          8        SEND_VAL_EX                                              'peter.jpg'
          9        SEND_VAL_EX                                              'image%2Fpng'
         10        DO_FCALL                                      0          
         11        ASSIGN_DIM                                               !0
         12        OP_DATA                                                  $7
   29    13        NEW                                              $10     'MyFile'
         14        SEND_VAL_EX                                              'michal.jpg'
         15        SEND_VAL_EX                                              'image%2Fjpg'
         16        DO_FCALL                                      0          
         17        ASSIGN_DIM                                               !0
         18        OP_DATA                                                  $10
   32    19        NEW                                              $13     'MyFile'
         20        SEND_VAL_EX                                              'johan.jpg'
         21        SEND_VAL_EX                                              'image%2Fjpg'
         22        DO_FCALL                                      0          
         23        ASSIGN_DIM                                               !1
         24        OP_DATA                                                  $13
   33    25        NEW                                              $16     'MyFile'
         26        SEND_VAL_EX                                              'peter.jpg'
         27        SEND_VAL_EX                                              'image%2Fjpg'
         28        DO_FCALL                                      0          
         29        ASSIGN_DIM                                               !1
         30        OP_DATA                                                  $16
   35    31        INIT_FCALL                                               'array_diff'
         32        SEND_VAR                                                 !0
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                         $18     
         35        ASSIGN                                                   !2, $18
   37    36        INIT_FCALL                                               'var_dump'
         37        SEND_VAR                                                 !2
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Class MyFile:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RRXWc
function name:  __construct
number of ops:  7
compiled vars:  !0 = $filename, !1 = $mimeType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        ASSIGN_OBJ                                               'filename'
          3        OP_DATA                                                  !0
   10     4        ASSIGN_OBJ                                               'mimeType'
          5        OP_DATA                                                  !1
   11     6      > RETURN                                                   null

End of function __construct

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

End of function getfilename

Function getmimetype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RRXWc
function name:  getMimeType
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_R                                      ~0      'mimeType'
          1      > RETURN                                                   ~0
   19     2*     > RETURN                                                   null

End of function getmimetype

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RRXWc
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   FETCH_OBJ_R                                      ~0      'filename'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   23     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

End of class MyFile.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.35 ms | 1392 KiB | 17 Q