Malhar Lathkar has Published 155 Articles

PHP ErrorException

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 11:25:22

306 Views

IntroductionPHP's Exception class implements the Throwable interface. ErrorException class extends the Exception class. ErrorException is meant to be explicitly thrown when you want to catch and handle errors that would otherwise be ignored, such as Notices or Warnings.PHP core consists of following predefined error constantsValueConstantDescription1E_ERRORFatal run-time errors.2E_WARNINGRun-time warnings (non-fatal errors).4E_PARSECompile-time ... Read More

PHP ParseError

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 11:21:55

227 Views

IntroductionParseError class extends CompileError class. (Earlier it used to be subclass of Error class). This type of error is thrown while a PHP code inside a string that is given to eval() function as argument.The eval() function evaluates given string as PHP code.Syntaxeval ( string $code ) : mixedParametersSr.NoParameter & Description1codevalid ... Read More

PHP TypeError

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 11:19:39

188 Views

IntroductionTypeError class extends Error class. This error is raised when actual and formal argument types don't match, return type doesn't match the decalred returned type or invalid arguments passed to any built-in functionNote that strict_types should be set to true with declare() function at the top of script −In this example, types ... Read More

PHP Types of Errors

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 11:16:54

315 Views

IntroductionPHP's internal Error types are represented by classes that are inherited from Error class. The Error class implements Throwable interface. Properties and methods of Error class are as follows −propertiesmessage − The error messagecode − The error codefile − The filename where the error happenedline − The line where the ... Read More

PHP Zip context options

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 11:15:01

192 Views

IntroductionPHP's ZIP extension registers zip:// wrapper. PHP 7.2.0 onwards supports passwords for encrypted archives. There is only one Zip context option called passwordExampleFirst create ZIP archive as follows:

PHP SSL context options

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 11:13:40

1K+ Views

IntroductionList of Context options for ssl:// and tls:// transports.peer_namePeer name to be used. If this value is not set, then the name is guessed based on the hostname used when opening the stream.verify_peerRequire verification of SSL certificate used. Defaults to TRUE.verify_peer_nameRequire verification of peer name. Defaults to TRUE.allow_self_signedAllow self-signed certificates. Requires verify_peer. ... Read More

PHP Socket context options

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 11:09:42

275 Views

IntroductionAccess to filesystem and various other stream wrappers can be customized by various context options and parameters configures by stream_context_create() and stream_context_set_option() functions.Following list shows various socket context options are available for all wrappers that work over sockets, like tcp, http and ftp.bindtospecifies the IP address (either IPv4 or IPv6) and/or ... Read More

PHP Phar context options

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 09:28:45

141 Views

IntroductionPhar stands for PHP Archive. All the resources of a certain PHP application or library are packages in a single .phar file for the purpose of istribution. A phar file can be used as IO stream with phar:// wrapper. Context options for phar:// wrapper are listed as follows −compressPHP has following ... Read More

PHP Context Parameters

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 09:23:20

405 Views

IntroductionContext parameters allow customization of access to filesystem and other stream wrappers. To configure a stream, PHP has stream_context_set_params() function.Syntaxstream_context_set_params ( resource $stream_or_context , array $params ) : bool$stream_or_context can be any of PHP's supported streams/wrappers/contexts$params is an array with following properties. should be an associative array of the structure ... Read More

PHP MongoDB context options

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 09:21:52

104 Views

IntroductionPHP can interact with MongoDB database through database extensions. For older versions of PHP, mongo driver can be installed from PECL. This has now been replaced by mongodb driver. Both drivers can be installed using precompiled binaries for Linux/Windows/MacOS operating systems. Alternately, manual installation can be done from source tarball ... Read More

Advertisements