×
Clear all filters including search bar
Valeri Tandilashvili's PHP Notes
https it will make a request on 443 $ch = curl_init("https://xdatavpn.example.com/Bank");
If it starts with http the request will use 80 port$ch = curl_init("http://xdatavpn.example.com/Bank");catch blocktry {
undefinedFunction();
} catch (Error $e) {
echo 'Fatal error occurred: ' . $e->getMessage();
}
After running the above code on PHP 7+ the result will be:Fatal error occurred: Call to undefined function undefinedFunction()
If we run the same code on PHP 5.6, we will get the following result:<br />
<b>Fatal error</b>: Call to undefined function undefinedFunction() in <b>[...][...]</b> on line <b>5</b><br />1. Contains at least 8 characters
2. Contains at least one uppercase letter
3. Contains at least one lowercase letter
4. Contains at least one number
5. Contains at least one special characterfunction age($dob) {
// Seconds in a year
$seconds = 31556926;
// Calc. age based on the provided date_of_birth val
$age = floor((time() - strtotime($dob)) / $seconds);
return $age;
}$Datetime_object = DateTime::createFromFormat('Y-m-d', "2020-12-23");<? instead of <?php then we must configure short_open_tag setting in php.ini to on <?
echo '"short_open_tag" should be ON if we want to use short tags ' ;
?>abstract class AbstractClass
{
// Force Extending class to define this method
abstract protected function getValue();
abstract protected function prefixValue($prefix);
// Common method
public function printOut() {
print $this->getValue() . "\n";
}
}
About abstract class:
Classes defined as abstract cannot be instantiated
Any class that contains at least one abstract method must also be abstract
Methods defined as abstract simply declare the method's signature - they cannot define the implementationecho self::$someProperty;
Outside a classWheather::$someProperty;self::celsiusToFarenheit(20);
Outside a classWheather::celsiusToFarenheit(20);