http_response_code
Sets HTTP response status code 404
http_response_code(404);
register_shutdown_function('myexit');
function myexit()
{
echo "</schedule>";
}
// spread operator
let method1 = {...car}
// method1 === car // false
// method1.model = "F150"
// let sprd = {...car, color: "black", model:"ranger"}
if the comparison returns false so it cloned successfully because they will refer to a different location on memory. So we can add or update properties with another parameters after spread operator..// rest operator
let {...method2} = car
// let {model, ...rst} = car
// let {model, ...car} = {year:"2017", ...car}
rest operator is allows us to skip some propoerties..
we can also use it with spread operator and it will more useful because it can add or update properties at the same timeconst target = { a: 1, b: 2 };
const source = { b: 4, c: 5 };
const returnedTarget = Object.assign(target, source);
// using object.assign method first object will be simply concatenated to second one
also we can write empty {} brackets and set it empty object as a first argument
getmypid
- Gets PHP's process IDecho 'Current process ID:' . getmypid();
The output will be:Current process ID:4868
$argv
contains filename and parameters, when the php script
is called through command line (cmd). test_args.php
file content:<?php
echo 'Filename:'.$argv[0]."; ";
echo 'First parameter:'.$argv[1]."; ";
echo 'Second parameter:'.$argv[2]."; ";
If we run the command: php test_args.php first-param second-param
in cmd
the script above will output the following:Filename:test_args.php; First parameter:first-param; Second parameter:second-param;