3v4l.org

run code in 300+ PHP versions simultaneously
<?php { $port = isset($this->port->id) ? $this->port->id : null; return [ 'name' => 'required|unique:ports,name,'.$port, 'state'=> 'required_if:country_id,1', 'country_id' => 'required' ]; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Km81i
function name:  (null)
number of ops:  17
compiled vars:  !0 = $port
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_THIS                                       $1      
          1        FETCH_OBJ_IS                                     ~2      $1, 'port'
          2        ISSET_ISEMPTY_PROP_OBJ                                   ~2, 'id'
          3      > JMPZ                                                     ~3, ->9
          4    >   FETCH_THIS                                       $4      
          5        FETCH_OBJ_R                                      ~5      $4, 'port'
          6        FETCH_OBJ_R                                      ~6      ~5, 'id'
          7        QM_ASSIGN                                        ~7      ~6
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~7      null
         10    >   ASSIGN                                                   !0, ~7
    6    11        CONCAT                                           ~9      'required%7Cunique%3Aports%2Cname%2C', !0
         12        INIT_ARRAY                                       ~10     ~9, 'name'
    7    13        ADD_ARRAY_ELEMENT                                ~10     'required_if%3Acountry_id%2C1', 'state'
    8    14        ADD_ARRAY_ELEMENT                                ~10     'required', 'country_id'
         15      > RETURN                                                   ~10
   10    16*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.39 ms | 1393 KiB | 13 Q