3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $courseData['auth_url'] = 'http://learn.kognito.com/auth'; define('COURSE_PORTAL_URL', "https://dev-learn.kognito.com/auth"); $pattern = '/https?:\/\/learn[.]kognito[.]com\/auth/'; $replacement = COURSE_PORTAL_URL; $courseData['auth_url'] = preg_replace($pattern, $replacement, $courseData['auth_url'], 1); echo $courseData['auth_url'] . "?k=";
based on 0L3K3
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/2bTea
function name:  (null)
number of ops:  22
compiled vars:  !0 = $courseData, !1 = $pattern, !2 = $replacement
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN_DIM                                               !0, 'auth_url'
         1        OP_DATA                                                  'http%3A%2F%2Flearn.kognito.com%2Fauth'
   3     2        INIT_FCALL                                               'define'
         3        SEND_VAL                                                 'COURSE_PORTAL_URL'
         4        SEND_VAL                                                 'https%3A%2F%2Fdev-learn.kognito.com%2Fauth'
         5        DO_ICALL                                                 
   4     6        ASSIGN                                                   !1, '%2Fhttps%3F%3A%5C%2F%5C%2Flearn%5B.%5Dkognito%5B.%5Dcom%5C%2Fauth%2F'
   5     7        FETCH_CONSTANT                                   ~6      'COURSE_PORTAL_URL'
         8        ASSIGN                                                   !2, ~6
   6     9        INIT_FCALL                                               'preg_replace'
        10        SEND_VAR                                                 !1
        11        SEND_VAR                                                 !2
        12        FETCH_DIM_R                                      $9      !0, 'auth_url'
        13        SEND_VAR                                                 $9
        14        SEND_VAL                                                 1
        15        DO_ICALL                                         $10     
        16        ASSIGN_DIM                                               !0, 'auth_url'
        17        OP_DATA                                                  $10
   7    18        FETCH_DIM_R                                      $11     !0, 'auth_url'
        19        CONCAT                                           ~12     $11, '%3Fk%3D'
        20        ECHO                                                     ~12
        21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0