3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { /** * @JMS\Type("double") * * @var float */ protected $price; /** * @JMS\Type("string") * * @var string */ protected $priceTag; /** * @JMS\Type("DateTime<'h:i'>") * * @var \DateTime */ protected $time; /** * @param float $price * * @return $this */ public function setPrice($price) { $this->price = $price; return $this; } /** * @return float */ public function getPrice() { return $this->price; } /** * @param string $priceTag * * @return $this */ public function setPriceTag($priceTag) { $this->priceTag = $priceTag; return $this; } /** * @return string */ public function getPriceTag() { return $this->priceTag; } /** * @param \DateTime $time * * @return $this */ public function setTime($time) { $this->time = $time; return $this; } /** * @return \DateTime */ public function getTime() { return $this->time; } } $foo = new MyClass(); $foo->setPriceTag('test1'); $bar = new MyClass(); $bar->setPriceTag('test1'); $bam = new MyClass(); $bam->setPriceTag('test2'); $test = array($foo, $bar, $bam); print_r(array_unique($test, SORT_REGULAR));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR04g
function name:  (null)
number of ops:  30
compiled vars:  !0 = $foo, !1 = $bar, !2 = $bam, !3 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   87     0  E >   NEW                                              $4      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   88     3        INIT_METHOD_CALL                                         !0, 'setPriceTag'
          4        SEND_VAL_EX                                              'test1'
          5        DO_FCALL                                      0          
   90     6        NEW                                              $8      'MyClass'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $8
   91     9        INIT_METHOD_CALL                                         !1, 'setPriceTag'
         10        SEND_VAL_EX                                              'test1'
         11        DO_FCALL                                      0          
   93    12        NEW                                              $12     'MyClass'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $12
   94    15        INIT_METHOD_CALL                                         !2, 'setPriceTag'
         16        SEND_VAL_EX                                              'test2'
         17        DO_FCALL                                      0          
   96    18        INIT_ARRAY                                       ~16     !0
         19        ADD_ARRAY_ELEMENT                                ~16     !1
         20        ADD_ARRAY_ELEMENT                                ~16     !2
         21        ASSIGN                                                   !3, ~16
   98    22        INIT_FCALL                                               'print_r'
         23        INIT_FCALL                                               'array_unique'
         24        SEND_VAR                                                 !3
         25        SEND_VAL                                                 0
         26        DO_ICALL                                         $18     
         27        SEND_VAR                                                 $18
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Class MyClass:
Function setprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR04g
function name:  setPrice
number of ops:  6
compiled vars:  !0 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
   33     1        ASSIGN_OBJ                                               'price'
          2        OP_DATA                                                  !0
   35     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   36     5*     > RETURN                                                   null

End of function setprice

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

End of function getprice

Function setpricetag:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR04g
function name:  setPriceTag
number of ops:  6
compiled vars:  !0 = $priceTag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   RECV                                             !0      
   53     1        ASSIGN_OBJ                                               'priceTag'
          2        OP_DATA                                                  !0
   55     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   56     5*     > RETURN                                                   null

End of function setpricetag

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

End of function getpricetag

Function settime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NR04g
function name:  setTime
number of ops:  6
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   71     0  E >   RECV                                             !0      
   73     1        ASSIGN_OBJ                                               'time'
          2        OP_DATA                                                  !0
   75     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   76     5*     > RETURN                                                   null

End of function settime

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

End of function gettime

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.47 ms | 1400 KiB | 17 Q