Re: [PHP] What do you get for ...

2011-06-07 Thread Tim Streater
On 07 Jun 2011 at 11:35, Richard Quadling  wrote: 

> What do you get for ...
>
> php -r "var_dump(realpath(null));"

OS X:  string(10) "/Users/tim"


--
Cheers  --  Tim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] What do you get for ...

2011-06-07 Thread Steve Staples
On Tue, 2011-06-07 at 16:09 +0300, Vitalii Demianets wrote:
> On Tuesday 07 June 2011 13:35:06 Richard Quadling wrote:
> > Hi.
> >
> > What do you get for ...
> >
> > php -r "var_dump(realpath(null));"
> >
> 
> 1.
> PHP 5.3.6 @ Gentoo Linux(x86_64)
> 
> tmp $ php -r "print getcwd();"
> /var/tmp
> 
> tmp $ php -r "var_dump(realpath(null));"
> string(8) "/var/tmp"
> 
> 2.
> PHP 5.2.14 @ Linux(ARM) 
> 
> tmp $ php -r "print getcwd();"
> /var/tmp
> 
> tmp $ php -r "var_dump(realpath(null));"
> string(8) "/var/tmp"
> 
> -- 
> Vitalii
> 

sstaples@webdev01:~$ php -v
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan  6 2010
22:41:56) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
sstaples@webdev01:~$ 

sstaples@webdev01:~$ pwd
/home/sstaples
sstaples@webdev01:~$ php -r "var_dump(realpath(null));"
string(14) "/home/sstaples"
sstaples@webdev01:~$ 

I am running Ubuntu 9.10

Steve.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What do you get for ...

2011-06-07 Thread Vitalii Demianets
On Tuesday 07 June 2011 13:35:06 Richard Quadling wrote:
> Hi.
>
> What do you get for ...
>
> php -r "var_dump(realpath(null));"
>

1.
PHP 5.3.6 @ Gentoo Linux(x86_64)

tmp $ php -r "print getcwd();"
/var/tmp

tmp $ php -r "var_dump(realpath(null));"
string(8) "/var/tmp"

2.
PHP 5.2.14 @ Linux(ARM) 

tmp $ php -r "print getcwd();"
/var/tmp

tmp $ php -r "var_dump(realpath(null));"
string(8) "/var/tmp"

-- 
Vitalii

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What do you get for ...

2011-06-07 Thread Richard Quadling
On 7 June 2011 12:25, Stuart Dallas  wrote:
> On Tue, Jun 7, 2011 at 12:10 PM, Richard Quadling 
> wrote:
>>
>> > -Original Message-
>> > What output do you get on non Windows setups?
>
> OSX 10.6.7
> PHP 5.3.4
> OSX Server 10.6
> PHP 5.3.0
> Linux 2.6.35.4-rscloud (Rackspace cloud)
> PHP 5.3.6
> Linux 2.6.18 (CentOS)
> PHP 5.2.10
> Linux 2.6.18 (CentOS)
> PHP 5.2.13
> All return __DIR__.
> -Stuart
> --
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/

Thank you. I'll update the documentation appropriately.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What do you get for ...

2011-06-07 Thread Stuart Dallas
On Tue, Jun 7, 2011 at 12:10 PM, Richard Quadling wrote:

> > -Original Message-
> > What output do you get on non Windows setups?
>

OSX 10.6.7
PHP 5.3.4

OSX Server 10.6
PHP 5.3.0

Linux 2.6.35.4-rscloud (Rackspace cloud)
PHP 5.3.6

Linux 2.6.18 (CentOS)
PHP 5.2.10

Linux 2.6.18 (CentOS)
PHP 5.2.13

All return __DIR__.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


Re: [PHP] What do you get for ...

2011-06-07 Thread Richard Quadling
> -Original Message-
> What output do you get on non Windows setups?

Hmmm. I really should have asked what the non windows users get.

Oh. Look. I did.

;-)

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] What do you get for ...

2011-06-07 Thread admin
Microsoft Windows Version 5.1.2600

E:\>php -r "var_dump(realpath(null));"
string(41) "E:\"

E:\>

Richard L. Buskirk


-Original Message-
From: Richard Quadling [mailto:rquadl...@gmail.com] 
Sent: Tuesday, June 07, 2011 6:35 AM
To: PHP General list
Subject: [PHP] What do you get for ...

Hi.

What do you get for ...

php -r "var_dump(realpath(null));"

I'm wondering if the result should be a boolean false.

But I'm getting very different results for different versions of PHP
for Windows.

For PHP5+ (upto lastest 5.3.7-dev), the output is always the same as getcwd()

For PHP4, some very interesting differences ...

V4.0.0 : string(5) "Z:\\/"
V4.0.1 : string(5) "z:\\/"
V4.0.1pl1 : string(5) "z:\\/"
V4.0.2 : bool(false)
V4.0.3 : bool(false)
V4.0.4 : string(3) "z:\"
V4.0.4pl1 : string(3) "z:\"
V4.0.5 : string(3) "z:\"
V4.0.6 : string(3) "z:\"
V4.1.0 : string(3) "z:\"
V4.1.1 : string(3) "z:\"
V4.1.2 : string(3) "z:\"
V4.2.0 : string(98) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.2.x\php-4.2.0"
V4.2.1 : string(3) "z:\"
V4.2.2 : string(3) "z:\"
V4.2.3 : string(3) "z:\"
V4.2.3RC1 : string(3) "z:\"
V4.2.3RC2 : string(3) "z:\"
V4.3.0 : string(3) "z:\"
V4.3.0pre2 : string(102) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0pre2"
V4.3.0RC1 : string(101) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0RC1"
V4.3.0RC2 : string(101) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0RC2"
V4.3.0RC3 : string(101) "D:\Personal
Files\Downloads\Software\Programming\PHP\Official
Releases\PHP4.x.x\PHP4.3.x\php-4.3.0RC3"
V4.3.0RC4 : string(3) "z:\"
V4.3.1 : string(3) "z:\"
V4.3.10 : string(3) "z:\"
V4.3.11 : string(3) "z:\"
V4.3.2 : string(3) "z:\"
V4.3.2RC1 : string(3) "z:\"
V4.3.2RC2 : string(3) "z:\"
V4.3.2RC3 : string(3) "z:\"
V4.3.3 : string(3) "z:\"
V4.3.3RC1 : string(3) "z:\"
V4.3.3RC2 : string(3) "z:\"
V4.3.3RC3 : string(3) "z:\"
V4.3.3RC4 : string(3) "z:\"
V4.3.4 : string(3) "z:\"
V4.3.4RC1 : string(3) "z:\"
V4.3.4RC2 : string(3) "z:\"
V4.3.4RC3 : string(3) "z:\"
V4.3.5 : string(3) "z:\"
V4.3.5RC1 : string(3) "z:\"
V4.3.5RC2 : string(3) "z:\"
V4.3.5RC3 : string(3) "z:\"
V4.3.5RC4 : string(3) "z:\"
V4.3.6 : string(3) "z:\"
V4.3.6RC1 : string(3) "z:\"
V4.3.6RC2 : string(3) "z:\"
V4.3.6RC3 : string(3) "z:\"
V4.3.7 : string(3) "z:\"
V4.3.7RC1 : string(3) "z:\"
V4.3.8 : string(3) "z:\"
V4.3.9 : string(3) "z:\"
V4.3.9RC1 : string(3) "z:\"
V4.4.0 : string(3) "z:\"
V4.4.1 : string(3) "z:\"
V4.4.2 : string(3) "z:\"
V4.4.3 : string(3) "z:\"
V4.4.4 : string(3) "z:\"
V4.4.5 : string(3) "z:\"
V4.4.6 : string(3) "z:\"
V4.4.7 : string(3) "z:\"
V4.4.8 : string(3) "z:\"
V4.4.9 : string(3) "z:\"

Z:\ is essentially the equivalent of __DIR__ in this example.

What output do you get on non Windows setups?

php -r "var_dump(realpath(null));"

If the current releases on other OS's all have output equivalent to
getcwd(), then I'll change the documentation to at least mention that
a null or empty path equates to the current working directory for V5+.

Richard.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] What do you get for ...

2011-06-07 Thread Jason
>-Original Message-
>From: Richard Quadling [mailto:rquadl...@gmail.com] 
>Sent: 07 June 2011 11:35
>To: PHP General list
>Subject: [PHP] What do you get for ...
>
>Hi.
>
>What do you get for ...
>
>php -r "var_dump(realpath(null));"
>
>I'm wondering if the result should be a boolean false.
>
>But I'm getting very different results for different versions of PHP
>for Windows.
>
>For PHP5+ (upto lastest 5.3.7-dev), the output is always the same as getcwd()
>

[snip]

I get the following in Win7 Pro x64 SP1 running PHP 5.3.6:


--- BEGIN OUTPUT ---
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

D:\>php -r "var_dump(realpath(null));"
string(3) "D:\"

D:\>

-- END OUTPUT ---

HTH
J


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php