3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $vars = array( 'key' => 'XXX', 'password' => 'XXX', 'shipaccount' => 'XXX', 'billaccount' => 'XXX', 'dutyaccount' => 'XXX', 'freightaccount' => 'XXX', 'trackaccount' => 'XXX', 'meter' => 'XXX', 'shiptimestamp' => mktime(10, 0, 0, date("m"), date("d")+1, date("Y")), 'spodshipdate' => '2013-05-21', 'serviceshipdate' => '2013-04-26', 'readydate' => '2010-05-31T08:44:07', 'closedate' => date("Y-m-d"), 'pickupdate' => date("Y-m-d", mktime(8, 0, 0, date("m") , date("d")+1, date("Y"))), 'pickuptimestamp' => mktime(8, 0, 0, date("m") , date("d")+1, date("Y")), 'pickuplocationid' => 'XXX', 'pickupconfirmationnumber' => 'XXX', 'dispatchdate' => date("Y-m-d", mktime(8, 0, 0, date("m") , date("d")+1, date("Y"))), 'dispatchlocationid' => 'XXX', 'dispatchconfirmationnumber' => 'XXX', 'tag_readytimestamp' => mktime(10, 0, 0, date("m"), date("d")+1, date("Y")), 'tag_latesttimestamp' => mktime(20, 0, 0, date("m"), date("d")+1, date("Y")), 'expirationdate' => '2013-05-24', 'begindate' => '2013-04-22', 'enddate' => '2013-04-25', 'trackingnumber' => 'XXX', 'hubid' => 'XXX', 'jobid' => 'XXX', 'searchlocationphonenumber' => '5555555555', 'shipper' => array( 'Contact' => array( 'PersonName' => 'Sender Name', 'CompanyName' => 'Sender Company Name', 'PhoneNumber' => '1234567890' ), 'Address' => array( 'StreetLines' => array('Address Line 1'), 'City' => 'Collierville', 'StateOrProvinceCode' => 'TN', 'PostalCode' => '38017', 'CountryCode' => 'US', 'Residential' => 1 ) ), 'recipient' => array( 'Contact' => array( 'PersonName' => 'Recipient Name', 'CompanyName' => 'Recipient Company Name', 'PhoneNumber' => '1234567890' ), 'Address' => array( 'StreetLines' => array('Address Line 1'), 'City' => 'Herndon', 'StateOrProvinceCode' => 'VA', 'PostalCode' => '20171', 'CountryCode' => 'US', 'Residential' => 1 ) ), 'address1' => array( 'StreetLines' => array('10 Fed Ex Pkwy'), 'City' => 'Memphis', 'StateOrProvinceCode' => 'TN', 'PostalCode' => '38115', 'CountryCode' => 'US' ), 'address2' => array( 'StreetLines' => array('13450 Farmcrest Ct'), 'City' => 'Herndon', 'StateOrProvinceCode' => 'VA', 'PostalCode' => '20171', 'CountryCode' => 'US' ), 'searchlocationsaddress' => array( 'StreetLines'=> array('240 Central Park S'), 'City'=>'Austin', 'StateOrProvinceCode'=>'TX', 'PostalCode'=>'78701', 'CountryCode'=>'US' ), 'shippingchargespayment' => array( 'PaymentType' => 'SENDER', 'Payor' => array( 'ResponsibleParty' => array( 'AccountNumber' => getProperty('billaccount'), 'Contact' => null, 'Address' => array('CountryCode' => 'US') ) ) ), 'freightbilling' => array( 'Contact'=>array( 'ContactId' => 'freight1', 'PersonName' => 'Big Shipper', 'Title' => 'Manager', 'CompanyName' => 'Freight Shipper Co', 'PhoneNumber' => '1234567890' ), 'Address'=>array( 'StreetLines'=>array( '1202 Chalet Ln', 'Do Not Delete - Test Account' ), 'City' =>'Harrison', 'StateOrProvinceCode' => 'AR', 'PostalCode' => '72601-6353', 'CountryCode' => 'US' ) ), ); function getProperty($var){ if($var == 'key') Return 'XXX'; if($var == 'password') Return 'XXX'; if($var == 'shipaccount') Return 'XXX'; if($var == 'billaccount') Return 'XXX'; if($var == 'dutyaccount') Return 'XXX'; if($var == 'freightaccount') Return 'XXX'; if($var == 'trackaccount') Return 'XXX'; if($var == 'meter') Return 'XXX'; if($var == 'shiptimestamp') Return mktime(10, 0, 0, date("m"), date("d")+1, date("Y")); if($var == 'spodshipdate') Return '2013-05-21'; if($var == 'serviceshipdate') Return '2013-04-26'; if($var == 'readydate') Return '2010-05-31T08:44:07'; if($var == 'closedate') Return date("Y-m-d"); if($var == 'pickupdate') Return date("Y-m-d", mktime(8, 0, 0, date("m") , date("d")+1, date("Y"))); if($var == 'pickuptimestamp') Return mktime(8, 0, 0, date("m") , date("d")+1, date("Y")); if($var == 'pickuplocationid') Return 'XXX'; if($var == 'pickupconfirmationnumber') Return 'XXX'; if($var == 'dispatchdate') Return date("Y-m-d", mktime(8, 0, 0, date("m") , date("d")+1, date("Y"))); if($var == 'dispatchlocationid') Return 'XXX'; if($var == 'dispatchconfirmationnumber') Return 'XXX'; if($var == 'tag_readytimestamp') Return mktime(10, 0, 0, date("m"), date("d")+1, date("Y")); if($var == 'tag_latesttimestamp') Return mktime(20, 0, 0, date("m"), date("d")+1, date("Y")); if($var == 'expirationdate') Return '2013-05-24'; if($var == 'begindate') Return '2013-04-22'; if($var == 'enddate') Return '2013-04-25'; if($var == 'trackingnumber') Return 'XXX'; if($var == 'hubid') Return 'XXX'; if($var == 'jobid') Return 'XXX'; if($var == 'searchlocationphonenumber') Return '5555555555'; if($var == 'shipper') Return array( 'Contact' => array( 'PersonName' => 'Sender Name', 'CompanyName' => 'Sender Company Name', 'PhoneNumber' => '1234567890' ), 'Address' => array( 'StreetLines' => array('Address Line 1'), 'City' => 'Collierville', 'StateOrProvinceCode' => 'TN', 'PostalCode' => '38017', 'CountryCode' => 'US', 'Residential' => 1 ) ); if($var == 'recipient') Return array( 'Contact' => array( 'PersonName' => 'Recipient Name', 'CompanyName' => 'Recipient Company Name', 'PhoneNumber' => '1234567890' ), 'Address' => array( 'StreetLines' => array('Address Line 1'), 'City' => 'Herndon', 'StateOrProvinceCode' => 'VA', 'PostalCode' => '20171', 'CountryCode' => 'US', 'Residential' => 1 ) ); if($var == 'address1') Return array( 'StreetLines' => array('10 Fed Ex Pkwy'), 'City' => 'Memphis', 'StateOrProvinceCode' => 'TN', 'PostalCode' => '38115', 'CountryCode' => 'US' ); if($var == 'address2') Return array( 'StreetLines' => array('13450 Farmcrest Ct'), 'City' => 'Herndon', 'StateOrProvinceCode' => 'VA', 'PostalCode' => '20171', 'CountryCode' => 'US' ); if($var == 'searchlocationsaddress') Return array( 'StreetLines'=> array('240 Central Park S'), 'City'=>'Austin', 'StateOrProvinceCode'=>'TX', 'PostalCode'=>'78701', 'CountryCode'=>'US' ); if($var == 'shippingchargespayment') Return array( 'PaymentType' => 'SENDER', 'Payor' => array( 'ResponsibleParty' => array( 'AccountNumber' => getProperty('billaccount'), 'Contact' => null, 'Address' => array('CountryCode' => 'US') ) ) ); if($var == 'freightbilling') Return array( 'Contact'=>array( 'ContactId' => 'freight1', 'PersonName' => 'Big Shipper', 'Title' => 'Manager', 'CompanyName' => 'Freight Shipper Co', 'PhoneNumber' => '1234567890' ), 'Address'=>array( 'StreetLines'=>array( '1202 Chalet Ln', 'Do Not Delete - Test Account' ), 'City' =>'Harrison', 'StateOrProvinceCode' => 'AR', 'PostalCode' => '72601-6353', 'CountryCode' => 'US' ) ); } for ($i = 1; $i <= 10; $i++) { foreach($vars as $var => $response) { getProperty($var); } }
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0