If you want to be a respectable PHP programmer in this age, make sure you know about a few important things!
Familiarize yourself with PSR standards. The most important one is PSR-0 as it changed the way PHP is coded in version 5.3.
If you want to be a respectable PHP programmer in this age, make sure you know about a few important things!
Familiarize yourself with PSR standards. The most important one is PSR-0 as it changed the way PHP is coded in version 5.3.
I don't know enough about how programming languages work to even know what this is called. But when working on an event emitter, I thought it'd be cool if PHP would be able to support this:
class FooClass {
function bam() { echo 'BAM!'; }
}
function foo(array $bar = []) {
print_r($bar);
}
I hereby claim:
To claim this, I am signing this object:
// Copy/pasted from string.c | |
static char hexconvtab[] = "0123456789abcdef"; | |
// Copy/pasted from string.c | |
static zend_string *php_bin2hex(const unsigned char *old, const size_t oldlen) | |
{ | |
zend_string *result; | |
size_t i, j; | |
result = zend_string_safe_alloc(oldlen, 2 * sizeof(char), 0, 0); |
--TEST-- | |
Checks for return types on error | |
--SKIPIF-- | |
<?php | |
if (!extension_loaded('json')) die('skip: json extension not available'); | |
?> | |
--FILE-- | |
<?php | |
var_dump(json_last_error('foo')); | |
?> |
<?php namespace App\LaravelExtensions; | |
use Illuminate\Queue\QueueServiceProvider; | |
class MyQueueServiceProvider extends QueueServiceProvider { | |
/** | |
* Register the connectors on the queue manager. | |
* | |
* @param \Illuminate\Queue\QueueManager $manager |
This is a pivot of the original syntax proposal thanks to feedback from twitter.
The retry keyword adds to the try\catch\finally
block to optionally execute an arbitrary statement before jumping to the top of the try
block n
times.
TL;DR The retry
keyword offers a cleaner, more readable & more efficient solution to a common problem.
This works and takes args! |
FROM ubuntu:16.04 | |
MAINTAINER Sammy Kaye Powers | |
RUN apt-get update \ | |
&& apt-get install sudo vim git -y \ | |
&& apt-get install build-essential autoconf valgrind -y \ | |
&& apt-get install re2c bison -y \ | |
&& apt-get install libxml2-dev locales lcov -y |