Skip to content

Instantly share code, notes, and snippets.

@stealth35
stealth35 / alias.php
Created June 18, 2012 16:19
Alias weird 2
<?php
use stdClass as Object;
$class1 = 'stdClass';
$class2 = 'Object';
var_dump(new stdClass());
var_dump(new Object());
var_dump(new $class1());
@stealth35
stealth35 / alias.php
Created June 18, 2012 15:48
Alias weird
<?php
use DomDocument as Parser;
$p = new Parser();
var_dump(
method_exists($p, 'load'),
method_exists('Parser', 'load')
);
@stealth35
stealth35 / get_user_aliases.c
Created June 18, 2012 15:42
PHP get_user_aliases
static int copy_user_alias_name(zend_class_entry **pce TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *array = va_arg(args, zval *);
zend_class_entry *ce = *pce;
if ((ce->type == ZEND_USER_CLASS) && strcasecmp(hash_key->arKey, ce->name) != 0) {
add_assoc_string_ex(array, hash_key->arKey, hash_key->nKeyLength, (char *) ce->name, 1);
}
return ZEND_HASH_APPLY_KEEP;
@stealth35
stealth35 / test.c
Created June 15, 2012 09:57
PHP get_current_aliases
static int copy_current_alias_name(zval **ns TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *array = va_arg(args, zval *);
add_next_index_stringl(array, hash_key->arKey, hash_key->nKeyLength, 1);
return ZEND_HASH_APPLY_KEEP;
}
PHP_FUNCTION(get_current_aliases)
> PHP path: C:\Program Files (x86)\PHP\php.exe
> PHP version:
=> PHP 5.4.2 (cli) (built: May 3 2012 23:16:05)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
> mageekguy\atoum\tests\units\adapter...
[..__________________________________________________________][0/2]
[S.__________________________________________________________][1/2]
[SS__________________________________________________________][2/2]
=> Test duration: 0.01 second.
Options -Indexes
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
Inconsistencies when accessing protected members [\Zend\tests\access_modifiers_008.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Inconsistencies when accessing protected members - 2 [\Zend\tests\access_modifiers_009.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [\Zend\tests\bug48770.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [\Zend\tests\bug48770_2.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [\Zend\tests\bug48770_3.phpt] XFAIL REASON: See Bug #48770
Initial value of static var in method depends on the include time of the class definition [
{
"repositories": [
{
"type": "package",
"package": {
"name": "google/code-prettify",
"version": "1.0-dev",
"source": {
"url": "http://google-code-prettify.googlecode.com/svn/",
"type": "svn",
<?php
// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
array (
'application/andrew-inset' => 'ez',
'application/applixware' => 'aw',
'application/atom+xml' => 'atom',
'application/atomcat+xml' => 'atomcat',
'application/atomsvc+xml' => 'atomsvc',
'application/ccxml+xml' => 'ccxml',
'application/cdmi-capability' => 'cdmia',
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/