[TYPO3-english] print_r worries

Stephan Schuler Stephan.Schuler at netlogix.de
Tue Sep 2 12:04:00 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hey there.

The hint was not to use anything that prints output but a breakpoint provided by xdebug. Whatever you want to do, you most likely want to "just look a bit around". Besides the one property you currently expose through print_r there are a lot of other things you might want to see. What do you do currently? Adjust print_r until either having found the desired values or having reached $GLOBAL? Since I have an IDE connected to xdebug, I haven't used print_r a single time.

What's the reason for print_r at all?
Do you need to be reminded about property names or getter and setter methods of your objects? Use proper type hinting and an IDE being aware of that, you most likely can just go on coding with "->[ctrl+space]" without even starting a PHP process. There's nothing better than having an IDE complaining about type incompatible method calls *before* trying to execute that part of a script.
Do you want to know about attributes of arrays? Use xdebug and have almost everything in one single view, starting with $GLOBALS[TSFE] if you need to.

So really, you should start using xdebug and an IDE that provides you with type hinting.

But if you really want to keep using your browser output for debugging (and I call everything debugging that isn't regular production ready requests) you should use:
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump().

Regards,



Stephan Schuler
Web-Entwickler

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Website: media.netlogix.de



- ----------------------------
netlogix MobileDay: 4 Hersteller, 4 Lösungen, 1 Thema
Erfahren Sie, welche Lösung im Mobile Device Management für Sie die richtige ist. Jetzt anmelden:
http://it-training.netlogix.de/leistungen-angebote/events/netlogix-mobileday

E-Mails rechtssicher archivieren und bequem verwalten
Jetzt MangedArchiveService von Mailstore bis 30.09. buchen und zwei Monate kostenlos testen.
Jetzt informieren:http://it-services.netlogix.de/it-security-compliance/e-mail-archivierung/mailstore

- ----------------------------




netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Neuwieder Straße 10 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Internet: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



- -----Ursprüngliche Nachricht-----
Von: typo3-english-bounces at lists.typo3.org [mailto:typo3-english-bounces at lists.typo3.org] Im Auftrag von Bernhard Kraft
Gesendet: Dienstag, 2. September 2014 11:16
An: typo3-english at lists.typo3.org
Betreff: Re: [TYPO3-english] print_r worries

Hi,

On 09/02/2014 09:31 AM, Stefano Kowalke wrote:

> do you use PHPStorm as editor?

Since '97 I solely use Linux and as editor vim.

I tried Eclipse and Netbeans but all those UIs seem to bloated for me and change constantly. You always have to adopt to a changed interface.

Tried the "xdebug_var_dump()" which comes with xdebug but this yields the same problems. I will give the DebuggerUtility::var_dump() a try.


there is an xdebug interface for vim but I am not very used to it. This
could result in a discussion: I think debugging and just doing some
print_r's while developing are two different things. Altough I try to
use Test-Driven-Development in recent projects in comes out that this
approach is quite complicated when extending some existing code. At
least harder than for developing something new.



greetings,
Bernhard
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english

-----BEGIN PGP SIGNATURE-----
Version: PGP Universal 3.3.2 (Build 15238)
Charset: utf-8

wpUDBQFUBZYSpp0IwsibV8MBCGI3A/9LmSbxq5rrUKcJG3Nft9Cp38/oK5i6iB2b
W+0eMhDbTiXkhAhMJ13ezyYX4JhkZu+fO/o6Tiz1jLtOUe4hDrYJRj+8R1lLdtlj
dG7ttv5SNxwuCFOgtcGYbcS/Wk8WWwYFEJ7yf+1k3+qNRmPBWsEXK7a8YJzM1Aco
HKZMdaomKQ==
=xmli
-----END PGP SIGNATURE-----


More information about the TYPO3-english mailing list