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; } } $file1 = new MyFile("peter.jpg", "image/jpg"); $file2 = new MyFile("michal.jpg", "image/jpg"); $file3 = new MyFile("johan.jpg", "image/jpg"); $file4 = new MyFile("peter.jpg", "image/jpg"); $array1[] = $file1; $array1[] = $file2; $array2[] = $file3; $array2[] = $file4; $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/d7P5h
function name:  (null)
number of ops:  37
compiled vars:  !0 = $file1, !1 = $file2, !2 = $file3, !3 = $file4, !4 = $array1, !5 = $array2, !6 = $diffArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $7      'MyFile'
          1        SEND_VAL_EX                                              'peter.jpg'
          2        SEND_VAL_EX                                              'image%2Fjpg'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $7
   24     5        NEW                                              $10     'MyFile'
          6        SEND_VAL_EX                                              'michal.jpg'
          7        SEND_VAL_EX                                              'image%2Fjpg'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $10
   25    10        NEW                                              $13     'MyFile'
         11        SEND_VAL_EX                                              'johan.jpg'
         12        SEND_VAL_EX                                              'image%2Fjpg'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $13
   26    15        NEW                                              $16     'MyFile'
         16        SEND_VAL_EX                                              'peter.jpg'
         17        SEND_VAL_EX                                              'image%2Fjpg'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !3, $16
   28    20        ASSIGN_DIM                                               !4
         21        OP_DATA                                                  !0
   29    22        ASSIGN_DIM                                               !4
         23        OP_DATA                                                  !1
   31    24        ASSIGN_DIM                                               !5
         25        OP_DATA                                                  !2
   32    26        ASSIGN_DIM                                               !5
         27        OP_DATA                                                  !3
   34    28        INIT_FCALL                                               'array_diff'
         29        SEND_VAR                                                 !4
         30        SEND_VAR                                                 !5
         31        DO_ICALL                                         $23     
         32        ASSIGN                                                   !6, $23
   36    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !6
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Class MyFile:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d7P5h
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/d7P5h
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/d7P5h
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

End of class MyFile.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.03 ms | 1400 KiB | 17 Q