Jedi made some testing to show up how PHP is so bad at object oriented programming vs Ruby, so I tried the same test in Python:

class TestPy(object):
	def __init__(self, string):
		self.string = string
		self.counter = 0
		
	def testfunc(self):
		self.string += 'abc '
		'-'.join(self.testfunc2())
		
	def testfunc2(self):
		array = self.string.split()
		str = ''
		for word in array:
			if not str or self.counter < 0:
				str += word
			self.counter += 1
		return array
		
str = "initial string"
a = TestPy(str)	
for x  in range (0,4999):
	a.testfunc()

The Ruby code from Jedi: 0m17.576s with ruby 1.8.2
This Python code: 0m8.386s with python 2.5 and 0m8.958s with python 2.4.4, on an Imac 24".

The goal here is not to have the fastest one, as many optimizations could be made on this really dumb code, the test just prove the good implementation of boths Python and Ruby but not PHP

Who wants to do the same in Java ?